diff mbox series

[f2fs-dev] mkfs.f2fs: kill heap allocation

Message ID 20240221092113.403851-1-chao@kernel.org (mailing list archive)
State New
Headers show
Series [f2fs-dev] mkfs.f2fs: kill heap allocation | expand

Commit Message

Chao Yu Feb. 21, 2024, 9:21 a.m. UTC
No one uses this feature. Let's kill it.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 include/f2fs_fs.h       | 1 -
 man/mkfs.f2fs.8         | 6 +-----
 mkfs/f2fs_format.c      | 8 --------
 mkfs/f2fs_format_main.c | 5 +----
 4 files changed, 2 insertions(+), 18 deletions(-)
diff mbox series

Patch

diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 5e9dfad..b59997c 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -1475,7 +1475,6 @@  struct f2fs_configuration {
 	char *vol_uuid;
 	uint16_t s_encoding;
 	uint16_t s_encoding_flags;
-	int heap;
 	int32_t kd;
 	int32_t dump_fd;
 	struct device_info devices[MAX_DEVICES];
diff --git a/man/mkfs.f2fs.8 b/man/mkfs.f2fs.8
index 6670003..0dc367b 100644
--- a/man/mkfs.f2fs.8
+++ b/man/mkfs.f2fs.8
@@ -8,10 +8,6 @@  mkfs.f2fs \- create an F2FS file system
 .SH SYNOPSIS
 .B mkfs.f2fs
 [
-.B \-a
-.I heap-based-allocation
-]
-[
 .B \-c
 .I device-list
 ]
@@ -110,7 +106,7 @@  The exit code returned by
 is 0 on success and 1 on failure.
 .SH OPTIONS
 .TP
-.BI \-a " heap-based-allocation"
+.BI \-a " heap-based-allocation" (deprecated)
 Specify 1 or 0 to enable/disable heap based block allocation policy.
 If the value is equal to 1, each of active log areas are initially
 assigned separately according to the whole volume size.
diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index 63d675e..8f632f8 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -548,14 +548,6 @@  static int f2fs_prepare_super_block(void)
 		c.cur_seg[CURSEG_HOT_DATA] = 0;
 		c.cur_seg[CURSEG_COLD_DATA] = 0;
 		c.cur_seg[CURSEG_WARM_DATA] = 0;
-	} else if (c.heap) {
-		c.cur_seg[CURSEG_HOT_NODE] =
-				last_section(last_zone(total_zones));
-		c.cur_seg[CURSEG_WARM_NODE] = prev_zone(CURSEG_HOT_NODE);
-		c.cur_seg[CURSEG_COLD_NODE] = prev_zone(CURSEG_WARM_NODE);
-		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;
 		if (c.zoned_model == F2FS_ZONED_HM) {
diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c
index f3316f7..c98e73c 100644
--- a/mkfs/f2fs_format_main.c
+++ b/mkfs/f2fs_format_main.c
@@ -49,7 +49,6 @@  static void mkfs_usage()
 {
 	MSG(0, "\nUsage: mkfs.f2fs [options] device [sectors]\n");
 	MSG(0, "[options]:\n");
-	MSG(0, "  -a heap-based allocation [default:0]\n");
 	MSG(0, "  -b filesystem block size [default:4096]\n");
 	MSG(0, "  -c device1[,device2,...] up to 7 additional devices, except meta device\n");
 	MSG(0, "  -d debug level [default:0]\n");
@@ -84,8 +83,6 @@  static void f2fs_show_info()
 	MSG(0, "\n    F2FS-tools: mkfs.f2fs Ver: %s (%s)\n\n",
 				F2FS_TOOLS_VERSION,
 				F2FS_TOOLS_DATE);
-	if (c.heap == 0)
-		MSG(0, "Info: Disable heap-based policy\n");
 
 	MSG(0, "Info: Debug level = %d\n", c.dbg_lv);
 	if (c.extension_list[0])
@@ -191,7 +188,7 @@  static void f2fs_parse_options(int argc, char *argv[])
 			c.dbg_lv = -1;
 			break;
 		case 'a':
-			c.heap = atoi(optarg);
+			MSG(0, "Info: heap allocation is deprecated\n");
 			break;
 		case 'b':
 			c.blksize = atoi(optarg);