f2fs: introduce f2fs_change_bit to simplify the change bit logic

Introduce f2fs_change_bit to simplify the change bit logic in
function set_to_next_nat{sit}.

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Gu Zheng
2014-10-20 17:45:50 +08:00
committed by Jaegeuk Kim
parent fa528722d0
commit c6ac4c0ec4
3 changed files with 11 additions and 8 deletions
+9
View File
@@ -1073,6 +1073,15 @@ static inline int f2fs_clear_bit(unsigned int nr, char *addr)
return ret;
}
static inline void f2fs_change_bit(unsigned int nr, char *addr)
{
int mask;
addr += (nr >> 3);
mask = 1 << (7 - (nr & 0x07));
*addr ^= mask;
}
/* used for f2fs_inode_info->flags */
enum {
FI_NEW_INODE, /* indicate newly allocated inode */