mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
f2fs: test before set/clear bits
If the bit is already set, we don't need to reset it, and vice versa. Because we don't need to make the caches dirty for that. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
01229f5e1b
commit
61e0f2d0a5
@ -1003,6 +1003,7 @@ enum {
|
||||
|
||||
static inline void set_inode_flag(struct f2fs_inode_info *fi, int flag)
|
||||
{
|
||||
if (!test_bit(flag, &fi->flags))
|
||||
set_bit(flag, &fi->flags);
|
||||
}
|
||||
|
||||
@ -1013,6 +1014,7 @@ static inline int is_inode_flag_set(struct f2fs_inode_info *fi, int flag)
|
||||
|
||||
static inline void clear_inode_flag(struct f2fs_inode_info *fi, int flag)
|
||||
{
|
||||
if (test_bit(flag, &fi->flags))
|
||||
clear_bit(flag, &fi->flags);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user