mkfs.f2fs: allocate zones together to avoid random access

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

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim 2020-12-17 10:12:59 -08:00
parent 316e128fe3
commit 15474db2b3

View File

@ -510,6 +510,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);