Linux-NVDIMM Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Linda Knippers <linda.knippers@hpe.com>
To: Dan Williams <dan.j.williams@intel.com>, linux-nvdimm@lists.01.org
Subject: Re: [ndctl PATCH 4/6] ndctl, list: emit device-dax 'chardev' by default
Date: Wed, 19 Jul 2017 16:13:54 -0400	[thread overview]
Message-ID: <596FBD82.1030608@hpe.com> (raw)
In-Reply-To: <150048919740.12895.4759356543014868451.stgit@dwillia2-desk3.amr.corp.intel.com>

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 <linda.knippers@hpe.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  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

  reply	other threads:[~2017-07-19 20:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19 18:32 [ndctl PATCH 0/6] multi-device-dax support and other fixes Dan Williams
2017-07-19 18:33 ` [ndctl PATCH 1/6] ndctl, daxctl: propagate loglevel to internal libdaxctl instance Dan Williams
2017-07-19 18:33 ` [ndctl PATCH 2/6] daxctl: stop carrying 'dax_region' in the daxctl_region region_path Dan Williams
2017-07-19 18:33 ` [ndctl PATCH 3/6] daxctl: fix support for multiple instances per-region id Dan Williams
2017-07-19 18:33 ` [ndctl PATCH 4/6] ndctl, list: emit device-dax 'chardev' by default Dan Williams
2017-07-19 20:13   ` Linda Knippers [this message]
2017-07-19 18:33 ` [ndctl PATCH 5/6] daxctl, list: clarify output when multiple regions share an id Dan Williams
2017-07-19 18:33 ` [ndctl PATCH 6/6] test: add multi-dax test Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=596FBD82.1030608@hpe.com \
    --to=linda.knippers@hpe.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox