* [f2fs-dev][PATCH V2] resize.f2fs: add option for large_nat_bitmap feature
@ 2020-01-13 6:52 ping xiong
2020-01-13 8:56 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: ping xiong @ 2020-01-13 6:52 UTC (permalink / raw)
To: yuchao0; +Cc: jaegeuk, linux-f2fs-devel, linux-kernel, xiongping1
From: xiongping1 <xiongping1@xiaomi.com>
resize.f2fs has already supported large_nat_bitmap feature, but has no
option to turn on it.
This change add a new '-i' option to control turning on it.
Signed-off-by: xiongping1 <xiongping1@xiaomi.com>
---
fsck/main.c | 6 +++++-
fsck/resize.c | 3 +++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/fsck/main.c b/fsck/main.c
index 9a7d499..e7e3dfc 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -104,6 +104,7 @@ void resize_usage()
MSG(0, "\nUsage: resize.f2fs [options] device\n");
MSG(0, "[options]:\n");
MSG(0, " -d debug level [default:0]\n");
+ MSG(0, " -i extended node bitmap, node ratio is 20%% by default\n");
MSG(0, " -s safe resize (Does not resize metadata)");
MSG(0, " -t target sectors [default: device size]\n");
MSG(0, " -V print the version number and exit\n");
@@ -449,7 +450,7 @@ void f2fs_parse_options(int argc, char *argv[])
break;
}
} else if (!strcmp("resize.f2fs", prog)) {
- const char *option_string = "d:st:V";
+ const char *option_string = "d:st:iV";
c.func = RESIZE;
while ((option = getopt(argc, argv, option_string)) != EOF) {
@@ -476,6 +477,9 @@ void f2fs_parse_options(int argc, char *argv[])
ret = sscanf(optarg, "%"PRIx64"",
&c.target_sectors);
break;
+ case 'i':
+ c.large_nat_bitmap = 1;
+ break;
case 'V':
show_version(prog);
exit(0);
diff --git a/fsck/resize.c b/fsck/resize.c
index fc563f2..46b1cfb 100644
--- a/fsck/resize.c
+++ b/fsck/resize.c
@@ -512,6 +512,9 @@ static void rebuild_checkpoint(struct f2fs_sb_info *sbi,
/* update nat_bits flag */
flags = update_nat_bits_flags(new_sb, cp, get_cp(ckpt_flags));
+ if (c.large_nat_bitmap)
+ flags |= CP_LARGE_NAT_BITMAP_FLAG;
+
if (flags & CP_COMPACT_SUM_FLAG)
flags &= ~CP_COMPACT_SUM_FLAG;
if (flags & CP_LARGE_NAT_BITMAP_FLAG)
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [f2fs-dev][PATCH V2] resize.f2fs: add option for large_nat_bitmap feature
2020-01-13 6:52 [f2fs-dev][PATCH V2] resize.f2fs: add option for large_nat_bitmap feature ping xiong
@ 2020-01-13 8:56 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2020-01-13 8:56 UTC (permalink / raw)
To: ping xiong; +Cc: jaegeuk, linux-f2fs-devel, linux-kernel, xiongping1
On 2020/1/13 14:52, ping xiong wrote:
> From: xiongping1 <xiongping1@xiaomi.com>
>
> resize.f2fs has already supported large_nat_bitmap feature, but has no
> option to turn on it.
>
> This change add a new '-i' option to control turning on it.
>
> Signed-off-by: xiongping1 <xiongping1@xiaomi.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-13 8:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 6:52 [f2fs-dev][PATCH V2] resize.f2fs: add option for large_nat_bitmap feature ping xiong
2020-01-13 8:56 ` Chao Yu
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).