aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2012-12-02 11:13:24 -0500
committerTheodore Ts'o <tytso@mit.edu>2012-12-02 11:13:24 -0500
commit152a7b0a808a00601328feba2001cbb2b530f771 (patch)
tree1994854df5b26d74705b36d3dd3771c8e4b714ea /fs/ext4
parentaeb1e5d69a5be592e86a926be73efb38c55af404 (diff)
ext4: move extra inode read to a new function
Currently, in ext4_iget we do a simple check to see whether there does exist some information starting from the end of i_extra_size. With inline data added, this procedure is more complicated. So move it to a new function named ext4_iget_extra_inode. Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inode.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 91a24967b8a..befa005711a 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3700,6 +3700,16 @@ static blkcnt_t ext4_inode_blocks(struct ext4_inode *raw_inode,
3700 } 3700 }
3701} 3701}
3702 3702
3703static inline void ext4_iget_extra_inode(struct inode *inode,
3704 struct ext4_inode *raw_inode,
3705 struct ext4_inode_info *ei)
3706{
3707 __le32 *magic = (void *)raw_inode +
3708 EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize;
3709 if (*magic == cpu_to_le32(EXT4_XATTR_MAGIC))
3710 ext4_set_inode_state(inode, EXT4_STATE_XATTR);
3711}
3712
3703struct inode *ext4_iget(struct super_block *sb, unsigned long ino) 3713struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
3704{ 3714{
3705 struct ext4_iloc iloc; 3715 struct ext4_iloc iloc;
@@ -3842,11 +3852,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
3842 ei->i_extra_isize = sizeof(struct ext4_inode) - 3852 ei->i_extra_isize = sizeof(struct ext4_inode) -
3843 EXT4_GOOD_OLD_INODE_SIZE; 3853 EXT4_GOOD_OLD_INODE_SIZE;
3844 } else { 3854 } else {
3845 __le32 *magic = (void *)raw_inode + 3855 ext4_iget_extra_inode(inode, raw_inode, ei);
3846 EXT4_GOOD_OLD_INODE_SIZE +
3847 ei->i_extra_isize;
3848 if (*magic == cpu_to_le32(EXT4_XATTR_MAGIC))
3849 ext4_set_inode_state(inode, EXT4_STATE_XATTR);
3850 } 3856 }
3851 } 3857 }
3852 3858