From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) (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 0EB7321D1B295 for ; Wed, 19 Jul 2017 13:13:44 -0700 (PDT) Message-ID: <596FBD82.1030608@hpe.com> Date: Wed, 19 Jul 2017 16:13:54 -0400 From: Linda Knippers MIME-Version: 1.0 Subject: Re: [ndctl PATCH 4/6] ndctl, list: emit device-dax 'chardev' by default References: <150048917662.12895.15953645444185664230.stgit@dwillia2-desk3.amr.corp.intel.com> <150048919740.12895.4759356543014868451.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <150048919740.12895.4759356543014868451.stgit@dwillia2-desk3.amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams , linux-nvdimm@lists.01.org List-ID: On 07/19/2017 02:33 PM, Dan Williams wrote: > Commit 10663a60d723 "ndctl, list: add '--device-dax' option" tried to > cleanup the default namespace output by putting the device-dax details > behind an extra option. This was done in anticipation of device-dax > sub-division support, but the kernel has since added support for > multiple-pmem namespaces per region and limiting device-dax instances to > one per parent namespace. With the limitation in place we can directly > associate a device-dax instance with a namespace and omit the dax-region > details in ndctl. $ ndctl list ... { "dev":"namespace7.0", "mode":"dax", "size":8453619712, "uuid":"c57b18aa-0c6a-4775-aa3e-e25f2a7c0c2f", "chardev":"dax7.0", "numa_node":1 }, ... Thanks! -- ljk > > Reported-by: Linda Knippers > Signed-off-by: Dan Williams > --- > util/json.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/util/json.c b/util/json.c > index 80512bdabeae..25188a61064f 100644 > --- a/util/json.c > +++ b/util/json.c > @@ -622,18 +622,28 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, > } else if (dax) { > struct daxctl_region *dax_region; > > + dax_region = ndctl_dax_get_daxctl_region(dax); > ndctl_dax_get_uuid(dax, uuid); > uuid_unparse(uuid, buf); > jobj = json_object_new_string(buf); > if (!jobj) > goto err; > json_object_object_add(jndns, "uuid", jobj); > - if (flags & UTIL_JSON_DAX) { > - dax_region = ndctl_dax_get_daxctl_region(dax); > + if ((flags & UTIL_JSON_DAX) && dax_region) { > jobj = util_daxctl_region_to_json(dax_region, NULL, > flags); > if (jobj) > json_object_object_add(jndns, "daxregion", jobj); > + } else if (dax_region) { > + struct daxctl_dev *dev; > + const char *name; > + > + dev = daxctl_dev_get_first(dax_region); > + name = daxctl_dev_get_devname(dev); > + jobj = json_object_new_string(name); > + if (!jobj) > + goto err; > + json_object_object_add(jndns, "chardev", jobj); > } > } else if (ndctl_namespace_get_type(ndns) != ND_DEVICE_NAMESPACE_IO) { > const char *name; > _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm