summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2024-02-06 13:56:27 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2024-02-27 09:41:12 -0800
commita60108f7dfb5867da1ad9c777d2fbbe47e4dbdd7 (patch)
treedc87eb96c6429d6dd4a29350fe2380158782dc47 /fs/f2fs/super.c
parent87161a2b0aed9e9b614bbf6fe8697ad560ceb0cb (diff)
downloadlinux-a60108f7dfb5867da1ad9c777d2fbbe47e4dbdd7.tar.gz
linux-a60108f7dfb5867da1ad9c777d2fbbe47e4dbdd7.tar.bz2
linux-a60108f7dfb5867da1ad9c777d2fbbe47e4dbdd7.zip
f2fs: use BLKS_PER_SEG, BLKS_PER_SEC, and SEGS_PER_SEC
No functional change. Reviewed-by: Daeho Jeong <daehojeong@google.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index f1516fd5088a..c0688c124aa7 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3643,7 +3643,7 @@ int f2fs_sanity_check_ckpt(struct f2fs_sb_info *sbi)
}
main_segs = le32_to_cpu(raw_super->segment_count_main);
- blocks_per_seg = sbi->blocks_per_seg;
+ blocks_per_seg = BLKS_PER_SEG(sbi);
for (i = 0; i < NR_CURSEG_NODE_TYPE; i++) {
if (le32_to_cpu(ckpt->cur_node_segno[i]) >= main_segs ||
@@ -3756,8 +3756,8 @@ static void init_sb_info(struct f2fs_sb_info *sbi)
sbi->secs_per_zone = le32_to_cpu(raw_super->secs_per_zone);
sbi->total_sections = le32_to_cpu(raw_super->section_count);
sbi->total_node_count =
- (le32_to_cpu(raw_super->segment_count_nat) / 2)
- * sbi->blocks_per_seg * NAT_ENTRY_PER_BLOCK;
+ ((le32_to_cpu(raw_super->segment_count_nat) / 2) *
+ NAT_ENTRY_PER_BLOCK) << sbi->log_blocks_per_seg;
F2FS_ROOT_INO(sbi) = le32_to_cpu(raw_super->root_ino);
F2FS_NODE_INO(sbi) = le32_to_cpu(raw_super->node_ino);
F2FS_META_INO(sbi) = le32_to_cpu(raw_super->meta_ino);
@@ -3766,7 +3766,7 @@ static void init_sb_info(struct f2fs_sb_info *sbi)
sbi->next_victim_seg[BG_GC] = NULL_SEGNO;
sbi->next_victim_seg[FG_GC] = NULL_SEGNO;
sbi->max_victim_search = DEF_MAX_VICTIM_SEARCH;
- sbi->migration_granularity = sbi->segs_per_sec;
+ sbi->migration_granularity = SEGS_PER_SEC(sbi);
sbi->seq_file_ra_mul = MIN_RA_MUL;
sbi->max_fragment_chunk = DEF_FRAGMENT_SIZE;
sbi->max_fragment_hole = DEF_FRAGMENT_SIZE;