From: Wang Sheng-Hui <shhuiw@gmail.com>
To: jaegeuk.kim@samsung.com, linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH] f2fs-tools: fix the total_zones calculation in f2fs_prepare_super_block
Date: Fri, 28 Jun 2013 13:21:07 +0800 [thread overview]
Message-ID: <51CD1D43.5040004@gmail.com> (raw)
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
reply other threads:[~2013-06-28 5:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51CD1D43.5040004@gmail.com \
--to=shhuiw@gmail.com \
--cc=jaegeuk.kim@samsung.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.