Whamcloud - gitweb
Add an option to debugfs to open filesystems in exclusive mode
[tools/e2fsprogs.git] / lib / ext2fs / ext2_fs.h
index f9f96b5..e427add 100644 (file)
@@ -77,7 +77,7 @@
  * Macro-instructions used to manage several block sizes
  */
 #define EXT2_MIN_BLOCK_LOG_SIZE                10      /* 1024 */
-#define EXT2_MAX_BLOCK_LOG_SIZE                13      /* 8192 */
+#define EXT2_MAX_BLOCK_LOG_SIZE                16      /* 65536 */
 #define EXT2_MIN_BLOCK_SIZE    (1 << EXT2_MIN_BLOCK_LOG_SIZE)
 #define EXT2_MAX_BLOCK_SIZE    (1 << EXT2_MAX_BLOCK_LOG_SIZE)
 #ifdef __KERNEL__
@@ -233,6 +233,7 @@ struct ext2_dx_countlimit {
 #define EXT2_NOTAIL_FL                 0x00008000 /* file tail should not be merged */
 #define EXT2_DIRSYNC_FL                0x00010000 /* Synchronous directory modifications */
 #define EXT2_TOPDIR_FL                 0x00020000 /* Top of directory hierarchies*/
+#define EXT3_EXTENTS_FL                0x00080000 /* Inode uses extents */
 #define EXT2_RESERVED_FL               0x80000000 /* reserved for ext2 lib */
 
 #define EXT2_FL_USER_VISIBLE           0x0003DFFF /* User visible flags */
@@ -241,10 +242,26 @@ struct ext2_dx_countlimit {
 /*
  * ioctl commands
  */
+
+/* Used for online resize */
+struct ext2_new_group_input {
+       __u32 group;            /* Group number for this data */
+       __u32 block_bitmap;     /* Absolute block number of block bitmap */
+       __u32 inode_bitmap;     /* Absolute block number of inode bitmap */
+       __u32 inode_table;      /* Absolute block number of inode table start */
+       __u32 blocks_count;     /* Total number of blocks in this group */
+       __u16 reserved_blocks;  /* Number of reserved blocks in this group */
+       __u16 unused;           /* Number of reserved GDT blocks in group */
+};
+
 #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_GETVERSION_NEW                _IOR('f', 3, long)
+#define EXT2_IOC_SETVERSION_NEW                _IOW('f', 4, long)
+#define EXT2_IOC_GROUP_EXTEND          _IOW('f', 7, unsigned long)
+#define EXT2_IOC_GROUP_ADD             _IOW('f', 8,struct ext2_new_group_input)
 
 /*
  * Structure of an inode on the disk
@@ -303,6 +320,65 @@ struct ext2_inode {
        } osd2;                         /* OS dependent 2 */
 };
 
+/*
+ * Permanent part of an large inode on the disk
+ */
+struct ext2_inode_large {
+       __u16   i_mode;         /* File mode */
+       __u16   i_uid;          /* Low 16 bits of Owner Uid */
+       __u32   i_size;         /* Size in bytes */
+       __u32   i_atime;        /* Access time */
+       __u32   i_ctime;        /* Creation time */
+       __u32   i_mtime;        /* Modification time */
+       __u32   i_dtime;        /* Deletion Time */
+       __u16   i_gid;          /* Low 16 bits of Group Id */
+       __u16   i_links_count;  /* Links count */
+       __u32   i_blocks;       /* Blocks count */
+       __u32   i_flags;        /* File flags */
+       union {
+               struct {
+                       __u32  l_i_reserved1;
+               } linux1;
+               struct {
+                       __u32  h_i_translator;
+               } hurd1;
+               struct {
+                       __u32  m_i_reserved1;
+               } masix1;
+       } osd1;                         /* OS dependent 1 */
+       __u32   i_block[EXT2_N_BLOCKS];/* Pointers to blocks */
+       __u32   i_generation;   /* File version (for NFS) */
+       __u32   i_file_acl;     /* File ACL */
+       __u32   i_dir_acl;      /* Directory ACL */
+       __u32   i_faddr;        /* Fragment address */
+       union {
+               struct {
+                       __u8    l_i_frag;       /* Fragment number */
+                       __u8    l_i_fsize;      /* Fragment size */
+                       __u16   i_pad1;
+                       __u16   l_i_uid_high;   /* these 2 fields    */
+                       __u16   l_i_gid_high;   /* were reserved2[0] */
+                       __u32   l_i_reserved2;
+               } linux2;
+               struct {
+                       __u8    h_i_frag;       /* Fragment number */
+                       __u8    h_i_fsize;      /* Fragment size */
+                       __u16   h_i_mode_high;
+                       __u16   h_i_uid_high;
+                       __u16   h_i_gid_high;
+                       __u32   h_i_author;
+               } hurd2;
+               struct {
+                       __u8    m_i_frag;       /* Fragment number */
+                       __u8    m_i_fsize;      /* Fragment size */
+                       __u16   m_pad1;
+                       __u32   m_i_reserved2[2];
+               } masix2;
+       } osd2;                         /* OS dependent 2 */
+       __u16   i_extra_isize;
+       __u16   i_pad1;
+};
+
 #define i_size_high    i_dir_acl
 
 #if defined(__KERNEL__) || defined(__linux__)
@@ -446,8 +522,8 @@ struct ext2_super_block {
        __u32   s_default_mount_opts;
        __u32   s_first_meta_bg;        /* First metablock group */
        __u32   s_mkfs_time;            /* When the filesystem was created */
-       __u32   s_jnl_blocks[16];       /* Backup of the journal inode */
-       __u32   s_reserved[173];        /* Padding to the end of the block */
+       __u32   s_jnl_blocks[17];       /* Backup of the journal inode */
+       __u32   s_reserved[172];        /* Padding to the end of the block */
 };
 
 /*
@@ -502,6 +578,8 @@ struct ext2_super_block {
 #define EXT3_FEATURE_INCOMPAT_RECOVER          0x0004 /* Needs recovery */
 #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV      0x0008 /* Journal device */
 #define EXT2_FEATURE_INCOMPAT_META_BG          0x0010
+#define EXT3_FEATURE_INCOMPAT_EXTENTS          0x0040
+
 
 #define EXT2_FEATURE_COMPAT_SUPP       0
 #define EXT2_FEATURE_INCOMPAT_SUPP     (EXT2_FEATURE_INCOMPAT_FILETYPE)