ext4: enable ext4 inline support
authorTao Ma <boyu.mt@taobao.com>
Mon, 10 Dec 2012 19:06:03 +0000 (14:06 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 10 Dec 2012 19:06:03 +0000 (14:06 -0500)
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/ialloc.c

index 6cfe546282dc35dd843e88d2147c3ef67d971ffc..b90e2720b826da7cc92288bf0d0d88637ec9f602 100644 (file)
@@ -1529,7 +1529,8 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
                                         EXT4_FEATURE_INCOMPAT_EXTENTS| \
                                         EXT4_FEATURE_INCOMPAT_64BIT| \
                                         EXT4_FEATURE_INCOMPAT_FLEX_BG| \
-                                        EXT4_FEATURE_INCOMPAT_MMP)
+                                        EXT4_FEATURE_INCOMPAT_MMP |    \
+                                        EXT4_FEATURE_INCOMPAT_INLINE_DATA)
 #define EXT4_FEATURE_RO_COMPAT_SUPP    (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
                                         EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
                                         EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
index c7efa88d714922a2cdd877ecee4b464f4221dac9..3f32c80124470e772c8f79dce042ccadde3bd66f 100644 (file)
@@ -902,6 +902,10 @@ got:
 
        ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize;
 
+       ei->i_inline_off = 0;
+       if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_INLINE_DATA))
+               ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
+
        ret = inode;
        dquot_initialize(inode);
        err = dquot_alloc_inode(inode);