mkfs.f2fs: expand scalability of nat bitmap
authorChao Yu <yuchao0@huawei.com>
Thu, 25 Jan 2018 11:45:13 +0000 (19:45 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 7 May 2018 21:49:37 +0000 (14:49 -0700)
commitbaaa076b4d576042913cfe34169442dfda651ca4
tree7d8f4341874f9a06fcd985c8385d1a469744c517
parent06addd3c1ee5d85961f46c7da5834427646b85d7
mkfs.f2fs: expand scalability of nat bitmap

Previously, our total node number (nat_bitmap) and total nat segment count
will not monotonously increase along with image size, and max nat_bitmap size
is limited by "CHECKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1", it is
with bad scalability when user wants to create more inode/node in larger image.

So this patch tries to relieve the limitation, by default, limitting total nat
entry number with 20% of total block number.

Before:
image_size(GB) nat_bitmap sit_bitmap nat_segment sit_segment
16 3836 64 36 2
32 3836 64 72 2
64 3772 128 116 4
128 3708 192 114 6
256 3580 320 110 10
512 3260 640 100 20
1024 2684 1216 82 38
2048 1468 2432 44 76
4096 3900 4800 120 150

After:
image_size(GB) nat_bitmap sit_bitmap nat_segment sit_segment
16 256 64 8 2
32 512 64 16 2
64 960 128 30 4
128 1856 192 58 6
256 3712 320 116 10
512 7424 640 232 20
1024 14787 1216 462 38
2048 29504 2432 922 76
4096 59008 4800 1844 150

Add a new option '-i' to control turning on/off this feature.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/f2fs.h
fsck/resize.c
include/f2fs_fs.h
lib/libf2fs.c
mkfs/f2fs_format.c
mkfs/f2fs_format_main.c