diff mbox

ndctl: drop ndctl.h dependency in blk+pmem acceptance tests

Message ID 20150911001905.12759.68823.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit ac538b6d3430
Headers show

Commit Message

Dan Williams Sept. 11, 2015, 12:19 a.m. UTC
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(-)

Comments

Ross Zwisler Sept. 11, 2015, 3:23 p.m. UTC | #1
On Thu, Sep 10, 2015 at 08:19:29PM -0400, Dan Williams wrote:
> 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>

Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
diff mbox

Patch

diff --git a/lib/blk_namespaces.c b/lib/blk_namespaces.c
index c3fee58f793b..1bea7bdb07b0 100644
--- a/lib/blk_namespaces.c
+++ b/lib/blk_namespaces.c
@@ -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;
 		}
diff --git a/lib/pmem_namespaces.c b/lib/pmem_namespaces.c
index 127e3bee79d8..28b582026677 100644
--- a/lib/pmem_namespaces.c
+++ b/lib/pmem_namespaces.c
@@ -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;
 		}