mkfs.f2fs: allocate zones together to avoid random access

commit 15474db2b3
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

This patch allocates zones to initial logs together, if it's on zoned device.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
Jaegeuk Kim 2020-12-17 10:12:59 -08:00 committed by dongsenhao
parent 153382836d
commit 00579ab00a

View File

@ -512,6 +512,13 @@ static int f2fs_prepare_super_block(void)
c.cur_seg[CURSEG_HOT_DATA] = prev_zone(CURSEG_COLD_NODE);
c.cur_seg[CURSEG_COLD_DATA] = 0;
c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA);
} else if (c.zoned_mode) {
c.cur_seg[CURSEG_HOT_NODE] = 0;
c.cur_seg[CURSEG_WARM_NODE] = next_zone(CURSEG_HOT_NODE);
c.cur_seg[CURSEG_COLD_NODE] = next_zone(CURSEG_WARM_NODE);
c.cur_seg[CURSEG_HOT_DATA] = next_zone(CURSEG_COLD_NODE);
c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_HOT_DATA);
c.cur_seg[CURSEG_COLD_DATA] = next_zone(CURSEG_WARM_DATA);
} else {
c.cur_seg[CURSEG_HOT_NODE] = 0;
c.cur_seg[CURSEG_WARM_NODE] = next_zone(CURSEG_HOT_NODE);