Skip to content

Commit 1dcdce5

Browse files
Ye Bintytso
authored andcommitted
ext4: move where set the MAY_INLINE_DATA flag is set
The only caller of ext4_find_inline_data_nolock() that needs setting of EXT4_STATE_MAY_INLINE_DATA flag is ext4_iget_extra_inode(). In ext4_write_inline_data_end() we just need to update inode->i_inline_off. Since we are going to add one more caller that does not need to set EXT4_STATE_MAY_INLINE_DATA, just move setting of EXT4_STATE_MAY_INLINE_DATA out to ext4_iget_extra_inode(). Signed-off-by: Ye Bin <[email protected]> Cc: [email protected] Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 3c92792 commit 1dcdce5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

fs/ext4/inline.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ int ext4_find_inline_data_nolock(struct inode *inode)
159159
(void *)ext4_raw_inode(&is.iloc));
160160
EXT4_I(inode)->i_inline_size = EXT4_MIN_INLINE_DATA_SIZE +
161161
le32_to_cpu(is.s.here->e_value_size);
162-
ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
163162
}
164163
out:
165164
brelse(is.iloc.bh);

fs/ext4/inode.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4797,8 +4797,13 @@ static inline int ext4_iget_extra_inode(struct inode *inode,
47974797

47984798
if (EXT4_INODE_HAS_XATTR_SPACE(inode) &&
47994799
*magic == cpu_to_le32(EXT4_XATTR_MAGIC)) {
4800+
int err;
4801+
48004802
ext4_set_inode_state(inode, EXT4_STATE_XATTR);
4801-
return ext4_find_inline_data_nolock(inode);
4803+
err = ext4_find_inline_data_nolock(inode);
4804+
if (!err && ext4_has_inline_data(inode))
4805+
ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
4806+
return err;
48024807
} else
48034808
EXT4_I(inode)->i_inline_off = 0;
48044809
return 0;

0 commit comments

Comments
 (0)