fsck.f2fs: refactor build_nat_area_bitmap to speed up fsck
authorJunling Zheng <zhengjunling@huawei.com>
Tue, 8 Nov 2016 00:48:10 +0000 (08:48 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 8 Nov 2016 01:05:51 +0000 (17:05 -0800)
commitea1bd1ce3152f86c5b82424654689911c406835d
tree9b325f7942bdfb945ba6529c1d88b44d918bfce3
parent5e056bef1798844e640e3ae118c06949c70dd8e6
fsck.f2fs: refactor build_nat_area_bitmap to speed up fsck

Refactor build_nat_area_bitmap, move out lookup_nat_in_journal from the
dual loops. Instead of looking up all nids in journals, we traverse nat
journals, whose entries are used to replace the NAT entries with the
corresponding nid to reduce the time build_nat_area_bitmap costs.

For "fsck -p 1", it reduces over half of the time.

Empty Fragmented Entirely
32G(ms):
  original 625.8 727.3
  improved 226.3 298.2
64G(ms):
  original 1159 1637.7
  improved 515.8 676.7

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/mount.c