diff options
author | Chao Yu <chao@kernel.org> | 2024-03-04 11:28:55 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-03-04 10:18:26 -0800 |
commit | 45809cd3bdac8743f08e42a32121e035aee69d88 (patch) | |
tree | f7551ba1b89380ac6e4cb2eab2dfd4efba05f088 /fs/f2fs/f2fs.h | |
parent | 22af1b8c31cbf7daf235a4fcb975089ad8c07fbe (diff) | |
download | linux-stable-45809cd3bdac8743f08e42a32121e035aee69d88.tar.gz linux-stable-45809cd3bdac8743f08e42a32121e035aee69d88.tar.bz2 linux-stable-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.h | 14 |
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, ...); |