summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2022-11-19 03:18:39 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2023-01-06 15:13:41 -0800
commitfdb7ccc3f9cb316c399b072c7a75a106678eb421 (patch)
tree57349896f734142df8e93159d7920345a02537d8 /fs/f2fs/segment.h
parentfdbf69a7f5be2896af3a9a6213fb0ab8e194b190 (diff)
downloadlinux-fdb7ccc3f9cb316c399b072c7a75a106678eb421.tar.gz
linux-fdb7ccc3f9cb316c399b072c7a75a106678eb421.tar.bz2
linux-fdb7ccc3f9cb316c399b072c7a75a106678eb421.zip
f2fs: introduce IS_F2FS_IPU_* macro
IS_F2FS_IPU_* macro can be used to identify whether f2fs ipu related policies are enabled. BTW, convert to use BIT() instead of open code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 3ad1b7b6fa94..e77518c49f38 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -681,6 +681,21 @@ enum {
F2FS_IPU_HONOR_OPU_WRITE,
};
+#define F2FS_IPU_POLICY(name) \
+static inline int IS_##name(struct f2fs_sb_info *sbi) \
+{ \
+ return SM_I(sbi)->ipu_policy & BIT(name); \
+}
+
+F2FS_IPU_POLICY(F2FS_IPU_FORCE);
+F2FS_IPU_POLICY(F2FS_IPU_SSR);
+F2FS_IPU_POLICY(F2FS_IPU_UTIL);
+F2FS_IPU_POLICY(F2FS_IPU_SSR_UTIL);
+F2FS_IPU_POLICY(F2FS_IPU_FSYNC);
+F2FS_IPU_POLICY(F2FS_IPU_ASYNC);
+F2FS_IPU_POLICY(F2FS_IPU_NOCACHE);
+F2FS_IPU_POLICY(F2FS_IPU_HONOR_OPU_WRITE);
+
static inline unsigned int curseg_segno(struct f2fs_sb_info *sbi,
int type)
{