diff mbox

[1/4] libndctl: rename parse_lbasize to parse_sizes

Message ID 20170627081531.7389-1-oohall@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Oliver O'Halloran June 27, 2017, 8:15 a.m. UTC
We want to re-use this code to parse the list of supported alignments
for dax and PFN devices so rename the function to reflect the more
generic usage.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 ndctl/lib/libndctl.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index 4acebc05d6db..aa262f03303e 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -234,12 +234,12 @@  struct ndctl_region {
 };
 
 /**
- * struct ndctl_lbasize - lbasize info for btt and blk-namespace devices
+ * struct ndctl_sizes - list of supported sector or alignments
  * @select: currently selected sector_size
  * @supported: possible sector_size options
  * @num: number of entries in @supported
  */
-struct ndctl_lbasize {
+struct ndctl_sizes {
 	int select;
 	unsigned int *supported;
 	int num;
@@ -270,7 +270,7 @@  struct ndctl_namespace {
 	unsigned long long resource, size;
 	char *alt_name;
 	uuid_t uuid;
-	struct ndctl_lbasize lbasize;
+	struct ndctl_sizes lbasize;
 	int numa_node;
 };
 
@@ -291,7 +291,7 @@  struct ndctl_btt {
 	struct ndctl_region *region;
 	struct ndctl_namespace *ndns;
 	struct list_node list;
-	struct ndctl_lbasize lbasize;
+	struct ndctl_sizes lbasize;
 	unsigned long long size;
 	char *btt_path;
 	char *btt_buf;
@@ -2855,8 +2855,8 @@  static char *get_block_device(struct ndctl_ctx *ctx, const char *block_path)
 	return bdev_name;
 }
 
-static int parse_lbasize_supported(struct ndctl_ctx *ctx, const char *devname,
-		const char *buf, struct ndctl_lbasize *lba);
+static int parse_sizes(struct ndctl_ctx *ctx, const char *devname,
+		const char *buf, struct ndctl_sizes *lba);
 
 static void *add_namespace(void *parent, int id, const char *ndns_base)
 {
@@ -2908,7 +2908,7 @@  static void *add_namespace(void *parent, int id, const char *ndns_base)
 		sprintf(path, "%s/sector_size", ndns_base);
 		if (sysfs_read_attr(ctx, path, buf) < 0)
 			goto err_read;
-		if (parse_lbasize_supported(ctx, devname, buf, &ndns->lbasize) < 0)
+		if (parse_sizes(ctx, devname, buf, &ndns->lbasize) < 0)
 			goto err_read;
 		/* fall through */
 	case ND_DEVICE_NAMESPACE_PMEM:
@@ -3738,8 +3738,8 @@  NDCTL_EXPORT int ndctl_namespace_delete(struct ndctl_namespace *ndns)
 	return 0;
 }
 
-static int parse_lbasize_supported(struct ndctl_ctx *ctx, const char *devname,
-		const char *buf, struct ndctl_lbasize *lba)
+static int parse_sizes(struct ndctl_ctx *ctx, const char *devname,
+		const char *buf, struct ndctl_sizes *lba)
 {
 	char *s = strdup(buf), *end, *field;
 	void *temp;
@@ -3830,7 +3830,7 @@  static void *add_btt(void *parent, int id, const char *btt_base)
 	sprintf(path, "%s/sector_size", btt_base);
 	if (sysfs_read_attr(ctx, path, buf) < 0)
 		goto err_read;
-	if (parse_lbasize_supported(ctx, devname, buf, &btt->lbasize) < 0)
+	if (parse_sizes(ctx, devname, buf, &btt->lbasize) < 0)
 		goto err_read;
 
 	sprintf(path, "%s/size", btt_base);