All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs-tools: fix the total_zones calculation in f2fs_prepare_super_block
@ 2013-06-28  5:21 Wang Sheng-Hui
  0 siblings, 0 replies; only message in thread
From: Wang Sheng-Hui @ 2013-06-28  5:21 UTC (permalink / raw)
  To: jaegeuk.kim, linux-f2fs-devel

We can count the main area as the data zones. Remove the '-1' miscalcuation.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
  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 f00ba04..4d7ea84 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);
-- 
1.7.10.4


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-28  5:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28  5:21 [f2fs-dev] [PATCH] f2fs-tools: fix the total_zones calculation in f2fs_prepare_super_block Wang Sheng-Hui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.