f2fs: avoid duplicate call of mark_inode_dirty
Let's check the condition first before set|clear bit. Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
ae2e2804ca
commit
766c663933
@ -3115,12 +3115,16 @@ static inline int is_file(struct inode *inode, int type)
|
|||||||
|
|
||||||
static inline void set_file(struct inode *inode, int type)
|
static inline void set_file(struct inode *inode, int type)
|
||||||
{
|
{
|
||||||
|
if (is_file(inode, type))
|
||||||
|
return;
|
||||||
F2FS_I(inode)->i_advise |= type;
|
F2FS_I(inode)->i_advise |= type;
|
||||||
f2fs_mark_inode_dirty_sync(inode, true);
|
f2fs_mark_inode_dirty_sync(inode, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void clear_file(struct inode *inode, int type)
|
static inline void clear_file(struct inode *inode, int type)
|
||||||
{
|
{
|
||||||
|
if (!is_file(inode, type))
|
||||||
|
return;
|
||||||
F2FS_I(inode)->i_advise &= ~type;
|
F2FS_I(inode)->i_advise &= ~type;
|
||||||
f2fs_mark_inode_dirty_sync(inode, true);
|
f2fs_mark_inode_dirty_sync(inode, true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user