]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: get the right gc victim section when section has several segments
authorJack Qiu <jack.qiu@huawei.com>
Thu, 18 Jun 2020 04:37:10 +0000 (12:37 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 18 Jun 2020 19:35:38 +0000 (12:35 -0700)
commit4aa19f3a341dee107dc7fc6290ab251df5b5377a
tree26735801a071d7434e511a417cc7a8b132c2fd5f
parentedcdd04a5522b164d9efd4467863ab646bf8b3e1
f2fs: get the right gc victim section when section has several segments

Assume each section has 4 segment:
     .___________________________.
     |_Segment0_|_..._|_Segment3_|
     .                          .
     .                  .
     .__________.
     |_section0_|

Segment 0~2 has 0 valid block, segment 3 has 512 valid blocks.
It will fail if we want to gc section0 in this scenes,
because all 4 segments in section0 is not dirty.
So we should use dirty section bitmap instead of dirty segment bitmap
to get right victim section.

Signed-off-by: Jack Qiu <jack.qiu@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/gc.c
fs/f2fs/segment.c
fs/f2fs/segment.h