@@ -15,7 +15,6 @@
#include <errno.h>
#include <fcntl.h>
#include <linux/fs.h>
-#include <linux/ndctl.h>
#include <ndctl/libndctl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -249,7 +248,7 @@ int test_blk_namespaces(int log_level)
/* create our config */
ndctl_region_foreach(bus, region)
- if (ndctl_region_get_nstype(region) == ND_DEVICE_NAMESPACE_BLK) {
+ if (strcmp(ndctl_region_get_type_name(region), "blk") == 0) {
blk_region = region;
break;
}
@@ -15,7 +15,6 @@
#include <errno.h>
#include <fcntl.h>
#include <linux/fs.h>
-#include <linux/ndctl.h>
#include <ndctl/libndctl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -209,7 +208,7 @@ int test_pmem_namespaces(int log_level)
/* create our config */
ndctl_region_foreach(bus, region)
- if (ndctl_region_get_nstype(region) == ND_DEVICE_NAMESPACE_PMEM) {
+ if (strcmp(ndctl_region_get_type_name(region), "pmem") == 0) {
pmem_region = region;
break;
}
They were not properly checking for HAVE_NDCTL_H and they can use the string name for the region type rather than the type number. Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- lib/blk_namespaces.c | 3 +-- lib/pmem_namespaces.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)