linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Sheng Yong <shengyong1@huawei.com>
To: jaegeuk@kernel.org, yuchao0@huawei.com
Cc: hyojun@google.com, miaoxie@huawei.com,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [RFC PATCH v2 3/7] f2fs-tools: init f2fs_configuration as 0
Date: Fri, 23 Feb 2018 11:17:57 +0800	[thread overview]
Message-ID: <20180223031801.231805-4-shengyong1@huawei.com> (raw)
In-Reply-To: <20180223031801.231805-1-shengyong1@huawei.com>

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
---
 lib/libf2fs.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index e8b1842..0c684d5 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -586,24 +586,17 @@ void f2fs_init_configuration(void)
 {
 	int i;
 
+	memset(&c, 0, sizeof(struct f2fs_configuration));
 	c.ndevs = 1;
-	c.total_sectors = 0;
-	c.sector_size = 0;
 	c.sectors_per_blk = DEFAULT_SECTORS_PER_BLOCK;
 	c.blks_per_seg = DEFAULT_BLOCKS_PER_SEGMENT;
 	c.rootdev_name = get_rootdev();
 	c.wanted_total_sectors = -1;
-	c.zoned_mode = 0;
-	c.zoned_model = 0;
-	c.zone_blocks = 0;
-#ifdef WITH_ANDROID
-	c.preserve_limits = 0;
-#else
+#ifndef WITH_ANDROID
 	c.preserve_limits = 1;
 #endif
 
 	for (i = 0; i < MAX_DEVICES; i++) {
-		memset(&c.devices[i], 0, sizeof(struct device_info));
 		c.devices[i].fd = -1;
 		c.devices[i].sector_size = DEFAULT_SECTOR_SIZE;
 		c.devices[i].end_blkaddr = -1;
@@ -611,19 +604,12 @@ void f2fs_init_configuration(void)
 	}
 
 	/* calculated by overprovision ratio */
-	c.reserved_segments = 0;
-	c.overprovision = 0;
 	c.segs_per_sec = 1;
 	c.secs_per_zone = 1;
 	c.segs_per_zone = 1;
-	c.heap = 0;
 	c.vol_label = "";
 	c.trim = 1;
-	c.trimmed = 0;
-	c.ro = 0;
 	c.kd = -1;
-	c.dry_run = 0;
-	c.large_nat_bitmap = 0;
 	c.fixed_time = -1;
 }
 
-- 
2.14.1


------------------------------------------------------------------------------
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-02-23  3:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23  3:17 [RFC PATCH v2 0/7] f2fs-tools: introduce F2FS_FEATURE_LOST_FOUND feature Sheng Yong
2018-02-23  3:17 ` [RFC PATCH v2 1/7] fsck.f2fs: fix typo Sheng Yong
2018-02-23  3:17 ` [RFC PATCH v2 2/7] mkfs.f2fs: introduce mkfs parameters in f2fs_configuration Sheng Yong
2018-02-23  3:17 ` Sheng Yong [this message]
2018-02-23  3:17 ` [RFC PATCH v2 4/7] fsck.f2fs: integrate sanity_check_inode to __check_inode_mode Sheng Yong
2018-02-23  3:17 ` [RFC PATCH v2 5/7] mkfs.f2fs: create lost+found directory Sheng Yong
2018-02-28  5:25   ` Jaegeuk Kim
2018-02-23  3:18 ` [RFC PATCH v2 6/7] fsck.f2fs: read nat block if nat entry is invalid Sheng Yong
2018-02-23  3:18 ` [RFC PATCH v2 7/7] fsck.f2fs: reconnect unreachable files to lost+found Sheng Yong
     [not found]   ` <0c849139-fdbe-9362-770c-ad4e9da57142@huawei.com>
     [not found]     ` <8abbaedf-ae3b-741f-d36f-d65f96739065@huawei.com>
2018-02-28  5:16       ` Jaegeuk Kim

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=20180223031801.231805-4-shengyong1@huawei.com \
    --to=shengyong1@huawei.com \
    --cc=hyojun@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=miaoxie@huawei.com \
    --cc=yuchao0@huawei.com \
    /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).