summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorGu Zheng <guz.fnst@cn.fujitsu.com>2014-10-20 17:45:50 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2014-11-03 16:07:36 -0800
commitc6ac4c0ec416e77cab09cac6cee2d100fbd7fc82 (patch)
tree24dd196ef82d5a87dc683640fb5366a1d27e19ba /fs/f2fs/f2fs.h
parentfa528722d06ecbee9d918b9eec58c5d4c2978839 (diff)
downloadlinux-c6ac4c0ec416e77cab09cac6cee2d100fbd7fc82.tar.bz2
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>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 3608c13aa7a2..60045a24f0d5 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -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 */