linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Junling Zheng <zhengjunling@huawei.com>
To: jaegeuk@google.com, katao@xiaomi.com
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [RFC PATCH] mkfs.f2fs: use 512B as the sector size criterion
Date: Wed, 28 Mar 2018 17:04:29 +0800	[thread overview]
Message-ID: <20180328090429.35291-1-zhengjunling@huawei.com> (raw)
In-Reply-To: <20180327171908.15092-1-jaegeuk@kernel.org>

Use 512 bytes as the sector size criterion while specifying the
amount of sectors passed to mkfs.

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
---
 lib/libf2fs.c           | 11 ++++++++---
 mkfs/f2fs_format_main.c |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index 5f11796..5fdcdde 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -1002,9 +1002,14 @@ int f2fs_get_device_info(void)
 		if (get_device_info(i))
 			return -1;
 
-	if (c.wanted_total_sectors < c.total_sectors) {
-		MSG(0, "Info: total device sectors = %"PRIu64" (in %u bytes)\n",
-				c.total_sectors, c.sector_size);
+	if (c.wanted_total_sectors > c.total_sectors)
+		MSG(0, "Warning: total sectors = %"PRIu64", "
+			"wanted sectors = %"PRIu64", in %u bytes\n",
+			c.total_sectors, c.wanted_total_sectors, c.sector_size);
+	else {
+		MSG(0, "Info: total sectors = %"PRIu64", "
+			"wanted sectors = %"PRIu64", in %u bytes\n",
+			c.total_sectors, c.wanted_total_sectors, c.sector_size);
 		c.total_sectors = c.wanted_total_sectors;
 		c.devices[0].total_sectors = c.total_sectors;
 	}
diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c
index f23fd84..71fd7c2 100644
--- a/mkfs/f2fs_format_main.c
+++ b/mkfs/f2fs_format_main.c
@@ -57,7 +57,7 @@ static void mkfs_usage()
 	MSG(0, "  -S sparse mode\n");
 	MSG(0, "  -t 0: nodiscard, 1: discard [default:1]\n");
 	MSG(0, "  -z # of sections per zone [default:1]\n");
-	MSG(0, "sectors: number of sectors. [default: determined by device size]\n");
+	MSG(0, "sectors: number of sectors (in 512 bytes). [default: determined by device size]\n");
 	exit(1);
 }
 
-- 
2.16.2


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

  parent reply	other threads:[~2018-03-28  9:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 17:19 [PATCH] libf2fs: reset wanted_total_sectors by new sector_size Jaegeuk Kim
2018-03-28  2:40 ` Junling Zheng
2018-03-28  9:04 ` Junling Zheng [this message]
     [not found]   ` <CAK6vGd9zBAmYRkVn9PObVvdfX6RfEDc+bmD-gg-+9+SvxsueiQ@mail.gmail.com>
2018-03-29  2:09     ` [RFC PATCH] mkfs.f2fs: use 512B as the sector size criterion Junling Zheng
2018-03-29  2:11       ` Jaegeuk Kim
2018-03-29  2:42       ` [RFC PATCH v2] " Junling Zheng
2018-03-30  9:28 ` [PATCH] libf2fs: reset wanted_total_sectors by new sector_size Chao Yu
2018-03-30 10:51   ` Junling Zheng
2018-03-30 11:26     ` Chao Yu
2018-03-30 11:34       ` Junling Zheng
2018-03-30 15:39         ` Jaegeuk Kim
2018-03-30 16:23           ` Jaegeuk Kim
2018-04-02  7:19           ` Chao Yu
2018-04-02 20:03             ` Jaegeuk Kim
2018-04-03  5:56               ` Chao Yu

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=20180328090429.35291-1-zhengjunling@huawei.com \
    --to=zhengjunling@huawei.com \
    --cc=jaegeuk@google.com \
    --cc=katao@xiaomi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).