From 716ea385bee0afe55ca7b18d49ed23df473288ef Mon Sep 17 00:00:00 2001 From: Wang Sheng-Hui Date: Fri, 28 Jun 2013 13:21:07 +0800 Subject: [PATCH] mkfs: fix the total_zones calculation in f2fs_prepare_super_block We can count the main area as the data zones. Remove the '-1' miscalcuation. Signed-off-by: Wang Sheng-Hui Signed-off-by: Jaegeuk Kim --- mkfs/f2fs_format.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 06771ff..c246974 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -372,9 +372,8 @@ static int f2fs_prepare_super_block(void) super_block.meta_ino = cpu_to_le32(2); super_block.root_ino = cpu_to_le32(3); - total_zones = ((le32_to_cpu(super_block.segment_count_main) - 1) / - config.segs_per_sec) / - config.secs_per_zone; + total_zones = le32_to_cpu(super_block.segment_count_main) / + (config.segs_per_sec * config.secs_per_zone); if (total_zones <= 6) { MSG(1, "\tError: %d zones: Need more zones \ by shrinking zone size\n", total_zones); -- 2.7.4