Message ID | 156426356654.531577.6142389862764297120.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Improvements for namespace creation/interrogation | expand |
On Sat, 2019-07-27 at 14:39 -0700, Dan Williams wrote: > Recent discussions on some platform implementations setting the LOCAL > bit in namespace labels makes it apparent that this field should be > decoded in the json representation. > > Signed-off-by: Dan Williams <dan.j.williams@intel.com> > --- > ndctl/dimm.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/ndctl/dimm.c b/ndctl/dimm.c > index b2b09b6aa9a2..8946dc74fe41 100644 > --- a/ndctl/dimm.c > +++ b/ndctl/dimm.c > @@ -141,6 +141,11 @@ static struct json_object *dump_label_json(struct ndctl_dimm *dimm, > break; > json_object_object_add(jlabel, "nlabel", jobj); > > + jobj = json_object_new_int64(le64_to_cpu(nslabel.flags)); Should we print this in hex instead? > + if (!jobj) > + break; > + json_object_object_add(jlabel, "flags", jobj); > + > jobj = json_object_new_int64(le64_to_cpu(nslabel.isetcookie)); > if (!jobj) > break; >
On Fri, Aug 2, 2019 at 11:01 AM Verma, Vishal L <vishal.l.verma@intel.com> wrote: > > > On Sat, 2019-07-27 at 14:39 -0700, Dan Williams wrote: > > Recent discussions on some platform implementations setting the LOCAL > > bit in namespace labels makes it apparent that this field should be > > decoded in the json representation. > > > > Signed-off-by: Dan Williams <dan.j.williams@intel.com> > > --- > > ndctl/dimm.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/ndctl/dimm.c b/ndctl/dimm.c > > index b2b09b6aa9a2..8946dc74fe41 100644 > > --- a/ndctl/dimm.c > > +++ b/ndctl/dimm.c > > @@ -141,6 +141,11 @@ static struct json_object *dump_label_json(struct ndctl_dimm *dimm, > > break; > > json_object_object_add(jlabel, "nlabel", jobj); > > > > + jobj = json_object_new_int64(le64_to_cpu(nslabel.flags)); > > Should we print this in hex instead? Ah, yes. /me goes to check why he didn't do this finds that this support arrives in the next patch that adds --human support to read-labels. So it's there in "ndctl/dimm: Add --human support to read-labels"
diff --git a/ndctl/dimm.c b/ndctl/dimm.c index b2b09b6aa9a2..8946dc74fe41 100644 --- a/ndctl/dimm.c +++ b/ndctl/dimm.c @@ -141,6 +141,11 @@ static struct json_object *dump_label_json(struct ndctl_dimm *dimm, break; json_object_object_add(jlabel, "nlabel", jobj); + jobj = json_object_new_int64(le64_to_cpu(nslabel.flags)); + if (!jobj) + break; + json_object_object_add(jlabel, "flags", jobj); + jobj = json_object_new_int64(le64_to_cpu(nslabel.isetcookie)); if (!jobj) break;
Recent discussions on some platform implementations setting the LOCAL bit in namespace labels makes it apparent that this field should be decoded in the json representation. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- ndctl/dimm.c | 5 +++++ 1 file changed, 5 insertions(+)