summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2024-03-04 11:28:55 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2024-03-04 10:18:26 -0800
commit45809cd3bdac8743f08e42a32121e035aee69d88 (patch)
treef7551ba1b89380ac6e4cb2eab2dfd4efba05f088 /fs/f2fs/f2fs.h
parent22af1b8c31cbf7daf235a4fcb975089ad8c07fbe (diff)
downloadlinux-45809cd3bdac8743f08e42a32121e035aee69d88.tar.gz
linux-45809cd3bdac8743f08e42a32121e035aee69d88.tar.bz2
linux-45809cd3bdac8743f08e42a32121e035aee69d88.zip
f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup
Just cleanup, no functional change. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 433101223e7a..4836e7cb0efe 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1815,12 +1815,14 @@ struct f2fs_sb_info {
};
/* Definitions to access f2fs_sb_info */
-#define BLKS_PER_SEG(sbi) \
- ((sbi)->blocks_per_seg)
-#define BLKS_PER_SEC(sbi) \
- ((sbi)->segs_per_sec << (sbi)->log_blocks_per_seg)
-#define SEGS_PER_SEC(sbi) \
- ((sbi)->segs_per_sec)
+#define SEGS_TO_BLKS(sbi, segs) \
+ ((segs) << (sbi)->log_blocks_per_seg)
+#define BLKS_TO_SEGS(sbi, blks) \
+ ((blks) >> (sbi)->log_blocks_per_seg)
+
+#define BLKS_PER_SEG(sbi) ((sbi)->blocks_per_seg)
+#define BLKS_PER_SEC(sbi) (SEGS_TO_BLKS(sbi, (sbi)->segs_per_sec))
+#define SEGS_PER_SEC(sbi) ((sbi)->segs_per_sec)
__printf(3, 4)
void f2fs_printk(struct f2fs_sb_info *sbi, bool limit_rate, const char *fmt, ...);