From 45809cd3bdac8743f08e42a32121e035aee69d88 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Mon, 4 Mar 2024 11:28:55 +0800 Subject: f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup Just cleanup, no functional change. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'fs/f2fs/f2fs.h') 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, ...); -- cgit v1.2.3