Skip to content

Commit 766c663

Browse files
author
Jaegeuk Kim
committed
f2fs: avoid duplicate call of mark_inode_dirty
Let's check the condition first before set|clear bit. Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent ae2e280 commit 766c663

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/f2fs/f2fs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3115,12 +3115,16 @@ static inline int is_file(struct inode *inode, int type)
31153115

31163116
static inline void set_file(struct inode *inode, int type)
31173117
{
3118+
if (is_file(inode, type))
3119+
return;
31183120
F2FS_I(inode)->i_advise |= type;
31193121
f2fs_mark_inode_dirty_sync(inode, true);
31203122
}
31213123

31223124
static inline void clear_file(struct inode *inode, int type)
31233125
{
3126+
if (!is_file(inode, type))
3127+
return;
31243128
F2FS_I(inode)->i_advise &= ~type;
31253129
f2fs_mark_inode_dirty_sync(inode, true);
31263130
}

0 commit comments

Comments
 (0)