diff mbox

[ndctl,13/17] ndctl, list: teach the list command about the 'fsdax' and 'devdax' modes

Message ID 151217073900.28402.5371420759088083712.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit 24f5c7bcad69
Headers show

Commit Message

Dan Williams Dec. 1, 2017, 11:25 p.m. UTC
Allow filtering namespaces by the same mode names used for
create-namespace.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 Documentation/ndctl/ndctl-list.txt |    2 +-
 ndctl/list.c                       |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/Documentation/ndctl/ndctl-list.txt b/Documentation/ndctl/ndctl-list.txt
index e19ded8a3ec2..fc07a71ff640 100644
--- a/Documentation/ndctl/ndctl-list.txt
+++ b/Documentation/ndctl/ndctl-list.txt
@@ -80,7 +80,7 @@  include::xable-region-options.txt[]
 
 -m::
 --mode=::
-	Filter listing by the mode ('raw', 'memory', 'sector' or 'dax')
+	Filter listing by the mode ('raw', 'fsdax', 'sector' or 'devdax')
 	of the namespace(s).
 
 -B::
diff --git a/ndctl/list.c b/ndctl/list.c
index d6e49b03a265..37a224a666ca 100644
--- a/ndctl/list.c
+++ b/ndctl/list.c
@@ -78,12 +78,16 @@  static enum ndctl_namespace_mode mode_to_type(const char *mode)
 
 	if (strcasecmp(param.mode, "memory") == 0)
 		return NDCTL_NS_MODE_MEMORY;
+	else if (strcasecmp(param.mode, "fsdax") == 0)
+		return NDCTL_NS_MODE_MEMORY;
 	else if (strcasecmp(param.mode, "sector") == 0)
 		return NDCTL_NS_MODE_SAFE;
 	else if (strcasecmp(param.mode, "safe") == 0)
 		return NDCTL_NS_MODE_SAFE;
 	else if (strcasecmp(param.mode, "dax") == 0)
 		return NDCTL_NS_MODE_DAX;
+	else if (strcasecmp(param.mode, "devdax") == 0)
+		return NDCTL_NS_MODE_DAX;
 	else if (strcasecmp(param.mode, "raw") == 0)
 		return NDCTL_NS_MODE_RAW;