diff options
author | Tao Ma <boyu.mt@taobao.com> | 2012-12-10 14:04:46 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-12-10 14:04:46 -0500 |
commit | 67cf5b09a46f72e048501b84996f2f77bc42e947 (patch) | |
tree | a03218e2d47fc2ea9875fbd245e5b7ec3985e25e /fs/ext4/inode.c | |
parent | 879b38257bf2b6fa8406693a3b5b5a0649e7c594 (diff) |
ext4: add the basic function for inline data support
Implement inline data with xattr.
Now we use "system.data" to store xattr, and the xattr will
be extended if the i_size is increased while we don't release
the space during truncate.
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index befa005711a1..e23f114e2cfe 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3706,8 +3706,10 @@ static inline void ext4_iget_extra_inode(struct inode *inode, | |||
3706 | { | 3706 | { |
3707 | __le32 *magic = (void *)raw_inode + | 3707 | __le32 *magic = (void *)raw_inode + |
3708 | EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize; | 3708 | EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize; |
3709 | if (*magic == cpu_to_le32(EXT4_XATTR_MAGIC)) | 3709 | if (*magic == cpu_to_le32(EXT4_XATTR_MAGIC)) { |
3710 | ext4_set_inode_state(inode, EXT4_STATE_XATTR); | 3710 | ext4_set_inode_state(inode, EXT4_STATE_XATTR); |
3711 | ext4_find_inline_data_nolock(inode); | ||
3712 | } | ||
3711 | } | 3713 | } |
3712 | 3714 | ||
3713 | struct inode *ext4_iget(struct super_block *sb, unsigned long ino) | 3715 | struct inode *ext4_iget(struct super_block *sb, unsigned long ino) |
@@ -3780,6 +3782,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) | |||
3780 | set_nlink(inode, le16_to_cpu(raw_inode->i_links_count)); | 3782 | set_nlink(inode, le16_to_cpu(raw_inode->i_links_count)); |
3781 | 3783 | ||
3782 | ext4_clear_state_flags(ei); /* Only relevant on 32-bit archs */ | 3784 | ext4_clear_state_flags(ei); /* Only relevant on 32-bit archs */ |
3785 | ei->i_inline_off = 0; | ||
3783 | ei->i_dir_start_lookup = 0; | 3786 | ei->i_dir_start_lookup = 0; |
3784 | ei->i_dtime = le32_to_cpu(raw_inode->i_dtime); | 3787 | ei->i_dtime = le32_to_cpu(raw_inode->i_dtime); |
3785 | /* We now have enough fields to check if the inode was active or not. | 3788 | /* We now have enough fields to check if the inode was active or not. |