sched: rt-group: interface
[sfrench/cifs-2.6.git] / include / linux / ext2_fs.h
index f7bd1c7ebefbd2a116c4970608b6cfb3c341bf90..84cec2aa9f1e98bd70ad9bb65ac58c06e2e9e5b4 100644 (file)
@@ -17,7 +17,7 @@
 #define _LINUX_EXT2_FS_H
 
 #include <linux/types.h>
-#include <linux/ext2_fs_sb.h>
+#include <linux/magic.h>
 
 /*
  * The second extended filesystem constants/structures
 #undef EXT2FS_DEBUG
 
 /*
- * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files
+ * Define EXT2_RESERVATION to reserve data blocks for expanding files
  */
-#define EXT2_PREALLOCATE
-#define EXT2_DEFAULT_PREALLOC_BLOCKS   8
-
+#define EXT2_DEFAULT_RESERVE_BLOCKS     8
+/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
+#define EXT2_MAX_RESERVE_BLOCKS         1027
+#define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0
 /*
  * The second extended file system version
  */
 /* First non-reserved inode for old ext2 filesystems */
 #define EXT2_GOOD_OLD_FIRST_INO        11
 
-/*
- * The second extended file system magic number
- */
-#define EXT2_SUPER_MAGIC       0xEF53
-
 #ifdef __KERNEL__
+#include <linux/ext2_fs_sb.h>
 static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
 {
        return sb->s_fs_info;
@@ -169,41 +166,51 @@ struct ext2_group_desc
 #define        EXT2_N_BLOCKS                   (EXT2_TIND_BLOCK + 1)
 
 /*
- * Inode flags
+ * Inode flags (GETFLAGS/SETFLAGS)
  */
-#define        EXT2_SECRM_FL                   0x00000001 /* Secure deletion */
-#define        EXT2_UNRM_FL                    0x00000002 /* Undelete */
-#define        EXT2_COMPR_FL                   0x00000004 /* Compress file */
-#define EXT2_SYNC_FL                   0x00000008 /* Synchronous updates */
-#define EXT2_IMMUTABLE_FL              0x00000010 /* Immutable file */
-#define EXT2_APPEND_FL                 0x00000020 /* writes to file may only append */
-#define EXT2_NODUMP_FL                 0x00000040 /* do not dump file */
-#define EXT2_NOATIME_FL                        0x00000080 /* do not update atime */
+#define        EXT2_SECRM_FL                   FS_SECRM_FL     /* Secure deletion */
+#define        EXT2_UNRM_FL                    FS_UNRM_FL      /* Undelete */
+#define        EXT2_COMPR_FL                   FS_COMPR_FL     /* Compress file */
+#define EXT2_SYNC_FL                   FS_SYNC_FL      /* Synchronous updates */
+#define EXT2_IMMUTABLE_FL              FS_IMMUTABLE_FL /* Immutable file */
+#define EXT2_APPEND_FL                 FS_APPEND_FL    /* writes to file may only append */
+#define EXT2_NODUMP_FL                 FS_NODUMP_FL    /* do not dump file */
+#define EXT2_NOATIME_FL                        FS_NOATIME_FL   /* do not update atime */
 /* Reserved for compression usage... */
-#define EXT2_DIRTY_FL                  0x00000100
-#define EXT2_COMPRBLK_FL               0x00000200 /* One or more compressed clusters */
-#define EXT2_NOCOMP_FL                 0x00000400 /* Don't compress */
-#define EXT2_ECOMPR_FL                 0x00000800 /* Compression error */
+#define EXT2_DIRTY_FL                  FS_DIRTY_FL
+#define EXT2_COMPRBLK_FL               FS_COMPRBLK_FL  /* One or more compressed clusters */
+#define EXT2_NOCOMP_FL                 FS_NOCOMP_FL    /* Don't compress */
+#define EXT2_ECOMPR_FL                 FS_ECOMPR_FL    /* Compression error */
 /* End compression flags --- maybe not all used */     
-#define EXT2_BTREE_FL                  0x00001000 /* btree format dir */
-#define EXT2_INDEX_FL                  0x00001000 /* hash-indexed directory */
-#define EXT2_IMAGIC_FL                 0x00002000 /* AFS directory */
-#define EXT2_JOURNAL_DATA_FL           0x00004000 /* Reserved for ext3 */
-#define EXT2_NOTAIL_FL                 0x00008000 /* file tail should not be merged */
-#define EXT2_DIRSYNC_FL                        0x00010000 /* dirsync behaviour (directories only) */
-#define EXT2_TOPDIR_FL                 0x00020000 /* Top of directory hierarchies*/
-#define EXT2_RESERVED_FL               0x80000000 /* reserved for ext2 lib */
-
-#define EXT2_FL_USER_VISIBLE           0x0003DFFF /* User visible flags */
-#define EXT2_FL_USER_MODIFIABLE                0x000380FF /* User modifiable flags */
+#define EXT2_BTREE_FL                  FS_BTREE_FL     /* btree format dir */
+#define EXT2_INDEX_FL                  FS_INDEX_FL     /* hash-indexed directory */
+#define EXT2_IMAGIC_FL                 FS_IMAGIC_FL    /* AFS directory */
+#define EXT2_JOURNAL_DATA_FL           FS_JOURNAL_DATA_FL /* Reserved for ext3 */
+#define EXT2_NOTAIL_FL                 FS_NOTAIL_FL    /* file tail should not be merged */
+#define EXT2_DIRSYNC_FL                        FS_DIRSYNC_FL   /* dirsync behaviour (directories only) */
+#define EXT2_TOPDIR_FL                 FS_TOPDIR_FL    /* Top of directory hierarchies*/
+#define EXT2_RESERVED_FL               FS_RESERVED_FL  /* reserved for ext2 lib */
+
+#define EXT2_FL_USER_VISIBLE           FS_FL_USER_VISIBLE      /* User visible flags */
+#define EXT2_FL_USER_MODIFIABLE                FS_FL_USER_MODIFIABLE   /* User modifiable flags */
 
 /*
  * ioctl commands
  */
-#define        EXT2_IOC_GETFLAGS               _IOR('f', 1, long)
-#define        EXT2_IOC_SETFLAGS               _IOW('f', 2, long)
-#define        EXT2_IOC_GETVERSION             _IOR('v', 1, long)
-#define        EXT2_IOC_SETVERSION             _IOW('v', 2, long)
+#define        EXT2_IOC_GETFLAGS               FS_IOC_GETFLAGS
+#define        EXT2_IOC_SETFLAGS               FS_IOC_SETFLAGS
+#define        EXT2_IOC_GETVERSION             FS_IOC_GETVERSION
+#define        EXT2_IOC_SETVERSION             FS_IOC_SETVERSION
+#define        EXT2_IOC_GETRSVSZ               _IOR('f', 5, long)
+#define        EXT2_IOC_SETRSVSZ               _IOW('f', 6, long)
+
+/*
+ * ioctl commands in 32 bit emulation
+ */
+#define EXT2_IOC32_GETFLAGS            FS_IOC32_GETFLAGS
+#define EXT2_IOC32_SETFLAGS            FS_IOC32_SETFLAGS
+#define EXT2_IOC32_GETVERSION          FS_IOC32_GETVERSION
+#define EXT2_IOC32_SETVERSION          FS_IOC32_SETVERSION
 
 /*
  * Structure of an inode on the disk
@@ -313,8 +320,9 @@ struct ext2_inode {
 #define EXT2_MOUNT_XATTR_USER          0x004000  /* Extended user attributes */
 #define EXT2_MOUNT_POSIX_ACL           0x008000  /* POSIX Access Control Lists */
 #define EXT2_MOUNT_XIP                 0x010000  /* Execute in place */
-#define EXT2_MOUNT_USRQUOTA            0x020000 /* user quota */
-#define EXT2_MOUNT_GRPQUOTA            0x040000 /* group quota */
+#define EXT2_MOUNT_USRQUOTA            0x020000  /* user quota */
+#define EXT2_MOUNT_GRPQUOTA            0x040000  /* group quota */
+#define EXT2_MOUNT_RESERVATION         0x080000  /* Preallocation */
 
 
 #define clear_opt(o, opt)              o &= ~EXT2_MOUNT_##opt
@@ -553,5 +561,6 @@ enum {
 #define EXT2_DIR_ROUND                         (EXT2_DIR_PAD - 1)
 #define EXT2_DIR_REC_LEN(name_len)     (((name_len) + 8 + EXT2_DIR_ROUND) & \
                                         ~EXT2_DIR_ROUND)
+#define EXT2_MAX_REC_LEN               ((1<<16)-1)
 
 #endif /* _LINUX_EXT2_FS_H */