From patchwork Fri Dec 1 23:25:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10088293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A2C16035E for ; Fri, 1 Dec 2017 23:33:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 888CF2A7B3 for ; Fri, 1 Dec 2017 23:33:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CC632A816; Fri, 1 Dec 2017 23:33:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1DCC42A7B3 for ; Fri, 1 Dec 2017 23:33:55 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 182A921A10988; Fri, 1 Dec 2017 15:29:28 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6BE6621A1098A for ; Fri, 1 Dec 2017 15:29:26 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2017 15:33:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,347,1508828400"; d="scan'208";a="8592282" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga003.jf.intel.com with ESMTP; 01 Dec 2017 15:33:53 -0800 Subject: [ndctl PATCH 13/17] ndctl, list: teach the list command about the 'fsdax' and 'devdax' modes From: Dan Williams To: linux-nvdimm@lists.01.org Date: Fri, 01 Dec 2017 15:25:39 -0800 Message-ID: <151217073900.28402.5371420759088083712.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <151217066885.28402.7962437173336388439.stgit@dwillia2-desk3.amr.corp.intel.com> References: <151217066885.28402.7962437173336388439.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Allow filtering namespaces by the same mode names used for create-namespace. Signed-off-by: Dan Williams --- Documentation/ndctl/ndctl-list.txt | 2 +- ndctl/list.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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;