f2fs: change the method of calculating the number summary blocks
authorFan Li <fanofcode.li@samsung.com>
Tue, 29 Oct 2013 08:21:47 +0000 (16:21 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Wed, 30 Oct 2013 03:17:58 +0000 (12:17 +0900)
commit9a47938b226cc2b8e2afd72b0f1ca1a7e1367cf5
tree8c3ae3af4617422cf4b25f04759584baccc43072
parentcc3de6a3acce264f4eb0b5bf552478e5f1380bba
f2fs: change the method of calculating the number summary blocks

npages_for_summary_flush uses (SUMMARY_SIZE + 1) as the size of a f2fs_summary
while its actual size is  SUMMARY_SIZE. So the result sometimes is bigger than
actual number by one, which causes checkpoint can't be written into disk
contiguously, and sometimes summary blocks can't be compacted like they should.
Besides, when writing summary blocks into pages, if remain space in a page
isn't big enough for one f2fs_summary, it will be left unused, current code
seems not to take it into account.

Signed-off-by: Fan Li <fanofcode.li@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/segment.c