Skip to contentSkip to conversation

mkfs.f2fs: use noheap by default

PATCH New Jaegeuk Kim 1 participant 1 message Mar 25, 2017 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.f2fs: use noheap by default

Let's set noheap by default.

---
 lib/libf2fs.c           | 2 +-
 mkfs/f2fs_format.c      | 8 ++++++--
 mkfs/f2fs_format_main.c | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)
lib/libf2fs.c +1 -1
index bb32df8..7352837 100644
@@ -568,7 +568,7 @@ void f2fs_init_configuration(void)
 	c.segs_per_sec = 1;
 	c.secs_per_zone = 1;
 	c.segs_per_zone = 1;
-	c.heap = 1;
+	c.heap = 0;
 	c.vol_label = "";
 	c.trim = 1;
 	c.ro = 0;
mkfs/f2fs_format.c +6 -2
index f6279b5..01f3488 100644
@@ -376,8 +376,12 @@ static int f2fs_prepare_super_block(void)
 		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_COLD_DATA] = next_zone(CURSEG_HOT_DATA);
-		c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA);
+		c.cur_seg[CURSEG_COLD_DATA] =
+				max(last_section(last_zone(total_zones)) >> 2,
+					next_zone(CURSEG_COLD_NODE));
+		c.cur_seg[CURSEG_WARM_DATA] =
+				max(last_section(last_zone(total_zones)) >> 1,
+					next_zone(CURSEG_COLD_DATA));
 	}
 
 	cure_extension_list();
mkfs/f2fs_format_main.c +1 -1
index 482506a..21ceeeb 100644
@@ -33,7 +33,7 @@ static void mkfs_usage()
 {
 	MSG(0, "\nUsage: mkfs.f2fs [options] device [sectors]\n");
 	MSG(0, "[options]:\n");
-	MSG(0, "  -a heap-based allocation [default:1]\n");
+	MSG(0, "  -a heap-based allocation [default:0]\n");
 	MSG(0, "  -c [device path] up to 7 devices excepts meta device\n");
 	MSG(0, "  -d debug level [default:0]\n");
 	MSG(0, "  -e [extension list] e.g. \"mp3,gif,mov\"\n");
Signature · 6 lines
2.11.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot