Whamcloud - gitweb
On-disk format for controlling the inode size
authorTheodore Ts'o <tytso@mit.edu>
Sat, 11 Nov 2006 14:45:22 +0000 (09:45 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 11 Nov 2006 14:45:22 +0000 (09:45 -0500)
- EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE (0x0040?) - add s_min_extra_isize and
  s_want_extra_isize fields to superblock, which allow specifying
  the minimum and desired i_extra_isize fields in large inodes
  (for nsec+epoch timestamps, potential other uses).  Needs RO_COMPAT
  flag handling, needs e2fsck support, patch complete, little testing.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/ChangeLog
lib/ext2fs/ext2_fs.h
lib/ext2fs/swapfs.c

index dedd6b9..3453d68 100644 (file)
@@ -1,5 +1,14 @@
 2006-11-11  Theodore Tso  <tytso@mit.edu>
 
+       * swapfs.c (ext2fs_swap_super):
+         ext2_fs.h: Add definition of EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE,
+               which adds s_min_extra_isize and s_want_extra_isize fields
+               to superblock, which allow specifying the minimum and 
+               desired i_extra_isize fields in large inodes 
+               (for nsec+epoch timestamps, potential other uses).  
+               Needs RO_COMPAT flag handling, needs e2fsck support, 
+               patch complete, little testing.
+
        * swapfs.c (ext2fs_swap_super): 
          ext2_fs.h: Add definition of EXT4_FEATURE_INCOMPAT_64BIT, 
                  which adds supports for 64-bit block count fields in the 
index f3c27ab..61958d9 100644 (file)
@@ -297,7 +297,7 @@ struct ext2_inode {
        __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_ctime;        /* Inode change time */
        __u32   i_mtime;        /* Modification time */
        __u32   i_dtime;        /* Deletion Time */
        __u16   i_gid;          /* Low 16 bits of Group Id */
@@ -353,7 +353,7 @@ struct ext2_inode_large {
        __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_ctime;        /* Inode Change time */
        __u32   i_mtime;        /* Modification time */
        __u32   i_dtime;        /* Deletion Time */
        __u16   i_gid;          /* Low 16 bits of Group Id */
@@ -401,6 +401,11 @@ struct ext2_inode_large {
        } osd2;                         /* OS dependent 2 */
        __u16   i_extra_isize;
        __u16   i_pad1;
+       __u32   i_ctime_extra;  /* extra Change time (nsec << 2 | epoch) */
+       __u32   i_mtime_extra;  /* extra Modification time (nsec << 2 | epoch) */
+       __u32   i_atime_extra;  /* extra Access time (nsec << 2 | epoch) */
+       __u32   i_crtime;       /* File creation time */
+       __u32   i_crtime_extra; /* extra File creation time (nsec << 2 | epoch)*/
 };
 
 #define i_size_high    i_dir_acl
@@ -550,7 +555,9 @@ struct ext2_super_block {
        __u32   s_blocks_count_hi;      /* Blocks count high 32bits */
        __u32   s_r_blocks_count_hi;    /* Reserved blocks count high 32 bits*/
        __u32   s_free_blocks_hi;       /* Free blocks count */
-       __u32   s_reserved[169];        /* Padding to the end of the block */
+       __u16   s_min_extra_isize;      /* All inodes have at least # bytes */
+       __u16   s_want_extra_isize;     /* New inodes should reserve # bytes */
+       __u32   s_reserved[168];        /* Padding to the end of the block */
 };
 
 /*
@@ -603,6 +610,7 @@ struct ext2_super_block {
 #define EXT4_FEATURE_RO_COMPAT_HUGE_FILE       0x0008
 #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM                0x0010
 #define EXT4_FEATURE_RO_COMPAT_DIR_NLINK       0x0020
+#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE     0x0040
 
 #define EXT2_FEATURE_INCOMPAT_COMPRESSION      0x0001
 #define EXT2_FEATURE_INCOMPAT_FILETYPE         0x0002
index f332e87..54a7925 100644 (file)
@@ -64,6 +64,11 @@ void ext2fs_swap_super(struct ext2_super_block * sb)
        sb->s_default_mount_opts = ext2fs_swab32(sb->s_default_mount_opts);
        sb->s_first_meta_bg = ext2fs_swab32(sb->s_first_meta_bg);
        sb->s_mkfs_time = ext2fs_swab32(sb->s_mkfs_time);
+       sb->s_blocks_count_hi = ext2fs_swab32(sb->s_blocks_count_hi);
+       sb->s_r_blocks_count_hi = ext2fs_swab32(sb->s_r_blocks_count_hi);
+       sb->s_free_blocks_hi = ext2fs_swab32(sb->s_free_blocks_hi);
+       sb->s_min_extra_isize = ext2fs_swab16(sb->s_min_extra_isize);
+       sb->s_want_extra_isize = ext2fs_swab16(sb->s_want_extra_isize);
        for (i=0; i < 4; i++)
                sb->s_hash_seed[i] = ext2fs_swab32(sb->s_hash_seed[i]);
        for (i=0; i < 17; i++)