Skip to contentSkip to conversation

f2fs-tools: allocate logs after conventional area for HM zoned devices

PATCH In review Daeho Jeong 2 participants 2 messages Jan 31, 2024 – Feb 1, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 f2fs-tools: allocate logs after conventional area for HM zoned devices

From: Daeho Jeong <[email protected]>

Make to allocate logs after conventional area for HM zoned devices to spare them for file pinning support.

---
v2: make current segment numbers relative to main start block. check
zoned block availability before the allocation.

---
 mkfs/f2fs_format.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
mkfs/f2fs_format.c +10 -0
index f2840c8..57ea9ea 100644
@@ -558,6 +558,16 @@ static int f2fs_prepare_super_block(void)
 		c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA);
 	} else if (c.zoned_mode) {
 		c.cur_seg[CURSEG_HOT_NODE] = 0;
+		if (c.zoned_model == F2FS_ZONED_HM) {
+			uint32_t conv_zones =
+				c.devices[0].total_segments / c.segs_per_zone
+				- total_meta_zones;
+
+			if (total_zones - conv_zones >= avail_zones)
+				c.cur_seg[CURSEG_HOT_NODE] =
+					(c.devices[1].start_blkaddr -
+					 get_sb(main_blkaddr)) / c.blks_per_seg;
+		}
 		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);
Signature · 1 line
2.43.0.429.g432eaa2c6b-goog