Skip to contentSkip to conversation

mkfs/fsck: add host-managed smr feature

PATCH In review Jaegeuk Kim 1 participant 2 messages Jun 14, 2016 – Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs/fsck: add host-managed smr feature

This feature flag will be used by f2fs to detect HMSMR device.

---
 fsck/mount.c            | 3 +++
 include/f2fs_fs.h       | 1 +
 mkfs/f2fs_format_main.c | 2 ++
 3 files changed, 6 insertions(+)
fsck/mount.c +3 -0
index 9d08118..e0223e0 100644
@@ -267,6 +267,9 @@ void print_sb_state(struct f2fs_super_block *sb)
 	if (f & cpu_to_le32(F2FS_FEATURE_ENCRYPT)) {
 		MSG(0, "%s", " encrypt");
 	}
+	if (f & cpu_to_le32(F2FS_FEATURE_HMSMR)) {
+		MSG(0, "%s", " host-managed SMR");
+	}
 	MSG(0, "\n");
 	MSG(0, "Info: superblock encrypt level = %d, salt = ",
 					sb->encryption_level);
include/f2fs_fs.h +1 -0
index 1045ede..1345e2d 100644
@@ -457,6 +457,7 @@ enum {
 #define MAX_ACTIVE_DATA_LOGS	8
 
 #define F2FS_FEATURE_ENCRYPT	0x0001
+#define F2FS_FEATURE_HMSMR	0x0002
 
 #define MAX_VOLUME_NAME		512
 
mkfs/f2fs_format_main.c +2 -0
index 8bd938c..f69d03f 100644
@@ -64,6 +64,8 @@ static void parse_feature(char *features)
 {
 	if (!strcmp(features, "encrypt")) {
 		config.feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT);
+	} else if (config.smr_mode) {
+		config.feature |= cpu_to_le32(F2FS_FEATURE_HMSMR);
 	} else {
 		MSG(0, "Error: Wrong features\n");
 		mkfs_usage();
Signature · 9 lines
2.8.3


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
#1 lore raw

Change log from v1:
- Fix wrong feature set.

Quoted 1 line

From 70a8fc3df7b72730fd2d40394892688292e8f78e Mon Sep 17 00:00:00 2001

From: Jaegeuk Kim <[email protected]>
Date: Mon, 13 Jun 2016 09:36:38 -0700
Subject: [PATCH] mkfs/fsck: add host-managed smr feature

This feature flag will be used by f2fs to detect HMSMR device.

---
 fsck/mount.c            | 3 +++
 include/f2fs_fs.h       | 1 +
 mkfs/f2fs_format_main.c | 3 +++
 3 files changed, 7 insertions(+)
fsck/mount.c +3 -0
index 9d08118..e0223e0 100644
@@ -267,6 +267,9 @@ void print_sb_state(struct f2fs_super_block *sb)
 	if (f & cpu_to_le32(F2FS_FEATURE_ENCRYPT)) {
 		MSG(0, "%s", " encrypt");
 	}
+	if (f & cpu_to_le32(F2FS_FEATURE_HMSMR)) {
+		MSG(0, "%s", " host-managed SMR");
+	}
 	MSG(0, "\n");
 	MSG(0, "Info: superblock encrypt level = %d, salt = ",
 					sb->encryption_level);
include/f2fs_fs.h +1 -0
index 1045ede..1345e2d 100644
@@ -457,6 +457,7 @@ enum {
 #define MAX_ACTIVE_DATA_LOGS	8
 
 #define F2FS_FEATURE_ENCRYPT	0x0001
+#define F2FS_FEATURE_HMSMR	0x0002
 
 #define MAX_VOLUME_NAME		512
 
mkfs/f2fs_format_main.c +3 -0
index 8bd938c..3741843 100644
@@ -130,6 +130,9 @@ static void f2fs_parse_options(int argc, char *argv[])
 
 	if ((optind + 1) < argc)
 		config.total_sectors = atoll(argv[optind+1]);
+
+	if (config.smr_mode)
+		config.feature |= cpu_to_le32(F2FS_FEATURE_HMSMR);
 }
 
 int main(int argc, char *argv[])
Signature · 9 lines
2.8.3


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381