ndctl: update .gitignore
PATCH 1/2 ndctl: update .gitignore
I noticed that my 'git status' output was quite noisy. Here's what I get with a full build using the suggested
./configure CFLAGS='-g -O0' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 command and with some cscope files built:
$ git status On branch pending Your branch is up-to-date with 'github/pending'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
Documentation/daxctl/asciidoc.conf Documentation/daxctl/daxctl-io.1 Documentation/daxctl/daxctl-list.1 Documentation/daxctl/daxctl.1 Documentation/ndctl/asciidoc.conf Documentation/ndctl/ndctl-check-labels.1 Documentation/ndctl/ndctl-check-namespace.1 Documentation/ndctl/ndctl-create-namespace.1 Documentation/ndctl/ndctl-destroy-namespace.1 Documentation/ndctl/ndctl-disable-dimm.1 Documentation/ndctl/ndctl-disable-namespace.1 Documentation/ndctl/ndctl-disable-region.1 Documentation/ndctl/ndctl-enable-dimm.1 Documentation/ndctl/ndctl-enable-namespace.1 Documentation/ndctl/ndctl-enable-region.1 Documentation/ndctl/ndctl-init-labels.1 Documentation/ndctl/ndctl-inject-error.1 Documentation/ndctl/ndctl-list.1 Documentation/ndctl/ndctl-read-labels.1 Documentation/ndctl/ndctl-write-labels.1 Documentation/ndctl/ndctl-zero-labels.1 Documentation/ndctl/ndctl.1 ccan/list/.dirstamp ccan/str/.dirstamp
cscope.files
cscope.out
daxctl/daxctl
daxctl/lib/libdaxctl.la daxctl/lib/libdaxctl.lo daxctl/lib/libdaxctl.pc
libccan.a
libutil.a
ndctl/lib/libndctl.pc
ndctl/ndctl
ndctl/util/.dirstamp
rhel/
sles/ndctl.spec
util/.dirstamp
util/log.lo
util/sysfs.lo
version.m4
nothing added to commit but untracked files present (use "git add" to track)
--- .gitignore | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
.gitignore +19 -0
@@ -12,3 +12,22 @@ Makefile.in /configure /libtool /stamp-h1 +*.1 +Documentation/daxctl/asciidoc.conf +Documentation/ndctl/asciidoc.conf +.dirstamp +daxctl/daxctl +daxctl/lib/libdaxctl.la +daxctl/lib/libdaxctl.lo +daxctl/lib/libdaxctl.pc +*.a +ndctl/lib/libndctl.pc +ndctl/ndctl +rhel/ +sles/ndctl.spec +util/log.lo +util/sysfs.lo +version.m4 +*.swp +cscope.files +cscope.out
Signature · 6 lines
2.14.3 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
PATCH 2/2 ndctl: add sector_size to 'ndctl list' output
It used to be that the only PMEM namespaces with a variable sector size were ones with a BTT, but that has changed. sector_size still doesn't make sense for device DAX since we don't have a block I/O path, and we also skip it if we don't have a specified sector size, as happens with namespaces of devtype nd_namespace_io.
--- util/json.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
util/json.c +17 -5
@@ -718,11 +718,6 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, goto err;json_object_object_add (jndns,"uuid" , jobj); - jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); -if (!jobj) - goto err; -json_object_object_add (jndns,"sector_size" , jobj); - bdev =ndctl_btt_get_block_device (btt); }else if (pfn) {ndctl_pfn_get_uuid (pfn, uuid);
@@ -774,6 +769,23 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, }else bdev =ndctl_namespace_get_block_device (ndns); + jobj =NULL ; +if (btt) { + jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); +if (!jobj) + goto err; + }else if (!dax) { +unsigned int sector_size =ndctl_namespace_get_sector_size (ndns); + +if (sector_size) { + jobj =json_object_new_int (sector_size); +if (!jobj) + goto err; + } + } +if (jobj) +json_object_object_add (jndns,"sector_size" , jobj); +if (bdev && bdev[0 ]) { jobj =json_object_new_string (bdev);if (!jobj)
Signature · 6 lines
2.14.3 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Re: [ndctl PATCH 2/2] ndctl: add sector_size to 'ndctl list' output
Quoted 7 lines · Ross Zwisler
It used to be that the only PMEM namespaces with a variable sector size were ones with a BTT, but that has changed.
sector_sizestill doesn't make sense for device DAX since we don't have a block I/O path, and we also skip it if we don't have a specified sector size, as happens with namespaces of devtypend_namespace_io.Signed-off-by Ross Zwisler <[email protected]>
Quoted 35 lines
--- util/json.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)util/json.c +10
-5@@ -718,11 +718,6 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, goto err;json_object_object_add (jndns,"uuid" , jobj); - jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); -if (!jobj) - goto err; -json_object_object_add (jndns,"sector_size" , jobj); - bdev =ndctl_btt_get_block_device (btt); }else if (pfn) {ndctl_pfn_get_uuid (pfn, uuid);@@ -774,6 +769,23 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, }else bdev =ndctl_namespace_get_block_device (ndns); + jobj =NULL ; +if (btt) { + jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); +if (!jobj) + goto err; + }else if (!dax) { +unsigned int sector_size =ndctl_namespace_get_sector_size (ndns); + +if (sector_size) { + jobj =json_object_new_int (sector_size);
util/json.c struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, · line 791
Quoted 10 lines
util/json.c +7
-0+if (!jobj) + goto err; + } + } +if (jobj) +json_object_object_add (jndns,"sector_size" , jobj); +if (bdev && bdev[0 ]) { jobj =json_object_new_string (bdev);if (!jobj)
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
PATCH v2 2/2 ndctl: add sector_size to 'ndctl list' output
In reply to Ross ZwislerIt used to be that the only PMEM namespaces with a variable sector size were ones with a BTT, but that has changed. sector_size still doesn't make sense for device DAX since we don't have a block I/O path.
If we don't have a specified sector size, as happens with namespaces of devtype nd_namespace_io and older v1.1 namespace labels, we will display the default sector size of 512.
--- util/json.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
util/json.c +18 -5
@@ -718,11 +718,6 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, goto err;json_object_object_add (jndns,"uuid" , jobj); - jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); -if (!jobj) - goto err; -json_object_object_add (jndns,"sector_size" , jobj); - bdev =ndctl_btt_get_block_device (btt); }else if (pfn) {ndctl_pfn_get_uuid (pfn, uuid);
@@ -774,6 +769,24 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, }else bdev =ndctl_namespace_get_block_device (ndns); + jobj =NULL ; +if (btt) { + jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); +if (!jobj) + goto err; + }else if (!dax) { +unsigned int sector_size =ndctl_namespace_get_sector_size (ndns); + +if (!sector_size) + sector_size =512 ; + + jobj =json_object_new_int (sector_size); +if (!jobj) + goto err; + } +if (jobj) +json_object_object_add (jndns,"sector_size" , jobj); +if (bdev && bdev[0 ]) { jobj =json_object_new_string (bdev);if (!jobj)
Signature · 6 lines
2.14.3 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Re: [ndctl PATCH v2 2/2] ndctl: add sector_size to 'ndctl list' output
Quoted 9 lines · Ross Zwisler
It used to be that the only PMEM namespaces with a variable sector size were ones with a BTT, but that has changed.
sector_sizestill doesn't make sense for device DAX since we don't have a block I/O path.If we don't have a specified sector size, as happens with namespaces of devtype
nd_namespace_ioand older v1.1 namespace labels, we will display the default sector size of 512.Signed-off-by Ross Zwisler <[email protected]>
Quoted 36 lines
--- util/json.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)util/json.c +11
-5@@ -718,11 +718,6 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, goto err;json_object_object_add (jndns,"uuid" , jobj); - jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); -if (!jobj) - goto err; -json_object_object_add (jndns,"sector_size" , jobj); - bdev =ndctl_btt_get_block_device (btt); }else if (pfn) {ndctl_pfn_get_uuid (pfn, uuid);@@ -774,6 +769,24 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, }else bdev =ndctl_namespace_get_block_device (ndns); + jobj =NULL ; +if (btt) { + jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); +if (!jobj) + goto err; + }else if (!dax) { +unsigned int sector_size =ndctl_namespace_get_sector_size (ndns); + +if (!sector_size) + sector_size =512 ; +
util/json.c struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, · line 792
Quoted 10 lines
util/json.c +7
-0+ jobj =json_object_new_int (sector_size); +if (!jobj) + goto err; + } +if (jobj) +json_object_object_add (jndns,"sector_size" , jobj); +if (bdev && bdev[0 ]) { jobj =json_object_new_string (bdev);if (!jobj)
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Re: [ndctl PATCH v2 2/2] ndctl: add sector_size to 'ndctl list' output
In reply to Ross ZwislerQuoted 31 lines · Ross Zwisler
It used to be that the only PMEM namespaces with a variable sector size were ones with a BTT, but that has changed.
sector_sizestill doesn't make sense for device DAX since we don't have a block I/O path.If we don't have a specified sector size, as happens with namespaces of devtype
nd_namespace_ioand older v1.1 namespace labels, we will display the default sector size of 512.Signed-off-by Ross Zwisler <[email protected]>--- util/json.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)util/json.c +0
-5@@ -718,11 +718,6 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, goto err;json_object_object_add (jndns,"uuid" , jobj); - jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); -if (!jobj) - goto err; -json_object_object_add (jndns,"sector_size" , jobj); - bdev =ndctl_btt_get_block_device (btt); }else if (pfn) {ndctl_pfn_get_uuid (pfn, uuid);@@ -774,6 +769,24 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, }else
util/json.c struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, · line 779
Quoted 10 lines
util/json.c +8
-0bdev =ndctl_namespace_get_block_device (ndns); + jobj =NULL ; +if (btt) { + jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); +if (!jobj) + goto err; + }else if (!dax) { +unsigned int sector_size =ndctl_namespace_get_sector_size (ndns); +
I'd put a comment here that says on kernel's that do not export a sector_size attribute, or if userspace fails to select a dynamic sector_size, the kernel default size is 512.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
PATCH v3 2/2 ndctl: add sector_size to 'ndctl list' output
It used to be that the only PMEM namespaces with a variable sector size were ones with a BTT, but that has changed. sector_size still doesn't make sense for device DAX since we don't have a block I/O path.
If we don't have a specified sector size, as happens with namespaces of devtype nd_namespace_io and older v1.1 namespace labels, we will display the default sector size of 512.
--- util/json.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-)
util/json.c +24 -5
@@ -718,11 +718,6 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, goto err;json_object_object_add (jndns,"uuid" , jobj); - jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); -if (!jobj) - goto err; -json_object_object_add (jndns,"sector_size" , jobj); - bdev =ndctl_btt_get_block_device (btt); }else if (pfn) {ndctl_pfn_get_uuid (pfn, uuid);
@@ -774,6 +769,30 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, }else bdev =ndctl_namespace_get_block_device (ndns); + jobj =NULL ; +if (btt) { + jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); +if (!jobj) + goto err; + }else if (!dax) { +unsigned int sector_size =ndctl_namespace_get_sector_size (ndns); + +/* +* The kernel will default to a 512 byte sector size on PMEM +* namespaces that don't explicitly have a sector size. This +* happens because they use pre-v1.2 labels or because they +* don't have a label space (devtype=nd_namespace_io). +*/ +if (!sector_size) + sector_size =512 ; + + jobj =json_object_new_int (sector_size); +if (!jobj) + goto err; + } +if (jobj) +json_object_object_add (jndns,"sector_size" , jobj); +if (bdev && bdev[0 ]) { jobj =json_object_new_string (bdev);if (!jobj)
Signature · 6 lines
2.14.3 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Re: [ndctl PATCH v3 2/2] ndctl: add sector_size to 'ndctl list' output
Quoted 62 lines · Ross Zwisler
It used to be that the only PMEM namespaces with a variable sector size were ones with a BTT, but that has changed.
sector_sizestill doesn't make sense for device DAX since we don't have a block I/O path.If we don't have a specified sector size, as happens with namespaces of devtype
nd_namespace_ioand older v1.1 namespace labels, we will display the default sector size of 512.Signed-off-by Ross Zwisler <[email protected]>Reviewed-by Dave Jiang <[email protected]>--- util/json.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-)util/json.c +24
-6@@ -718,11 +718,6 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, goto err;json_object_object_add (jndns,"uuid" , jobj); - jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); -if (!jobj) - goto err; -json_object_object_add (jndns,"sector_size" , jobj); - bdev =ndctl_btt_get_block_device (btt); }else if (pfn) {ndctl_pfn_get_uuid (pfn, uuid);@@ -774,6 +769,30 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, }else bdev =ndctl_namespace_get_block_device (ndns); + jobj =NULL ; +if (btt) { + jobj =json_object_new_int (ndctl_btt_get_sector_size (btt)); +if (!jobj) + goto err; + }else if (!dax) { +unsigned int sector_size =ndctl_namespace_get_sector_size (ndns); + +/* +* The kernel will default to a 512 byte sector size on PMEM +* namespaces that don't explicitly have a sector size. This +* happens because they use pre-v1.2 labels or because they +* don't have a label space (devtype=nd_namespace_io). +*/ +if (!sector_size) + sector_size =512 ; + + jobj =json_object_new_int (sector_size); +if (!jobj) + goto err; + } +if (jobj) +json_object_object_add (jndns,"sector_size" , jobj); +if (bdev && bdev[0 ]) { jobj =json_object_new_string (bdev);if (!jobj) --
Quoted 2 lines
2.14.3
Looks good to me, you can add:
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 54 lines · Ross Zwisler
I noticed that my 'git status' output was quite noisy. Here's what I get with a full build using the suggested
./configure CFLAGS='-g -O0' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 command and with some cscope files built:$ git status On branch pending Your branch is up-to-date with 'github/pending'.Untracked files:
(use "git add <file>..." to include in what will be committed)
Documentation/daxctl/asciidoc.confDocumentation/daxctl/daxctl-io.1Documentation/daxctl/daxctl-list.1Documentation/daxctl/daxctl.1Documentation/ndctl/asciidoc.confDocumentation/ndctl/ndctl-check-labels.1Documentation/ndctl/ndctl-check-namespace.1Documentation/ndctl/ndctl-create-namespace.1Documentation/ndctl/ndctl-destroy-namespace.1Documentation/ndctl/ndctl-disable-dimm.1Documentation/ndctl/ndctl-disable-namespace.1Documentation/ndctl/ndctl-disable-region.1Documentation/ndctl/ndctl-enable-dimm.1Documentation/ndctl/ndctl-enable-namespace.1Documentation/ndctl/ndctl-enable-region.1Documentation/ndctl/ndctl-init-labels.1Documentation/ndctl/ndctl-inject-error.1Documentation/ndctl/ndctl-list.1Documentation/ndctl/ndctl-read-labels.1Documentation/ndctl/ndctl-write-labels.1Documentation/ndctl/ndctl-zero-labels.1Documentation/ndctl/ndctl.1ccan/list/.dirstamp ccan/str/.dirstamp
cscope.files
cscope.out
daxctl/daxctl
daxctl/lib/libdaxctl.la daxctl/lib/libdaxctl.lo daxctl/lib/libdaxctl.pc
libccan.a
libutil.a
ndctl/lib/libndctl.pc
ndctl/ndctl
ndctl/util/.dirstamp
rhel/
sles/ndctl.spec
util/.dirstamp
util/log.lo
util/sysfs.lo
version.m4
Quoted 1 line
nothing added to commit but untracked files present (use "git add" to track)
Looks good to me, you can tell I don't use 'git status' in my workflow.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm