]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
libnvdimm: rename nd_sector_size_{show,store} to nd_size_select_{show,store}
authorDan Williams <dan.j.williams@intel.com>
Sat, 12 Aug 2017 00:36:54 +0000 (17:36 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sat, 12 Aug 2017 00:36:54 +0000 (17:36 -0700)
Prepare for other another consumer of this size selection scheme that is
not a 'sector size'.

Cc: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/btt_devs.c
drivers/nvdimm/core.c
drivers/nvdimm/namespace_devs.c
drivers/nvdimm/nd.h

index 3e359d282f8ea57cfad70ed64e4c27c2c15cc6f2..d58925295aa797a60098b3076056c08714e11bc3 100644 (file)
@@ -61,7 +61,7 @@ static ssize_t sector_size_show(struct device *dev,
 {
        struct nd_btt *nd_btt = to_nd_btt(dev);
 
-       return nd_sector_size_show(nd_btt->lbasize, btt_lbasize_supported, buf);
+       return nd_size_select_show(nd_btt->lbasize, btt_lbasize_supported, buf);
 }
 
 static ssize_t sector_size_store(struct device *dev,
@@ -72,7 +72,7 @@ static ssize_t sector_size_store(struct device *dev,
 
        device_lock(dev);
        nvdimm_bus_lock(dev);
-       rc = nd_sector_size_store(dev, buf, &nd_btt->lbasize,
+       rc = nd_size_select_store(dev, buf, &nd_btt->lbasize,
                        btt_lbasize_supported);
        dev_dbg(dev, "%s: result: %zd wrote: %s%s", __func__,
                        rc, buf, buf[len - 1] == '\n' ? "" : "\n");
index 75bc08c6838ccebe1c01e3cec8e9fe0db0fba33d..bb71f0cf8f5da3b1e31cff6521f2e6af298a595a 100644 (file)
@@ -277,14 +277,14 @@ int nd_uuid_store(struct device *dev, u8 **uuid_out, const char *buf,
        return 0;
 }
 
-ssize_t nd_sector_size_show(unsigned long current_lbasize,
+ssize_t nd_size_select_show(unsigned long current_size,
                const unsigned long *supported, char *buf)
 {
        ssize_t len = 0;
        int i;
 
        for (i = 0; supported[i]; i++)
-               if (current_lbasize == supported[i])
+               if (current_size == supported[i])
                        len += sprintf(buf + len, "[%ld] ", supported[i]);
                else
                        len += sprintf(buf + len, "%ld ", supported[i]);
@@ -292,8 +292,8 @@ ssize_t nd_sector_size_show(unsigned long current_lbasize,
        return len;
 }
 
-ssize_t nd_sector_size_store(struct device *dev, const char *buf,
-               unsigned long *current_lbasize, const unsigned long *supported)
+ssize_t nd_size_select_store(struct device *dev, const char *buf,
+               unsigned long *current_size, const unsigned long *supported)
 {
        unsigned long lbasize;
        int rc, i;
@@ -310,7 +310,7 @@ ssize_t nd_sector_size_store(struct device *dev, const char *buf,
                        break;
 
        if (supported[i]) {
-               *current_lbasize = lbasize;
+               *current_size = lbasize;
                return 0;
        } else {
                return -EINVAL;
index 5f1c6756e57ca6acffd9ba58e7e8ec746e6e8e48..1427a386a033e72f1f8ec7b4fe02471e9d5d92fb 100644 (file)
@@ -1313,14 +1313,14 @@ static ssize_t sector_size_show(struct device *dev,
        if (is_namespace_blk(dev)) {
                struct nd_namespace_blk *nsblk = to_nd_namespace_blk(dev);
 
-               return nd_sector_size_show(nsblk->lbasize,
+               return nd_size_select_show(nsblk->lbasize,
                                blk_lbasize_supported, buf);
        }
 
        if (is_namespace_pmem(dev)) {
                struct nd_namespace_pmem *nspm = to_nd_namespace_pmem(dev);
 
-               return nd_sector_size_show(nspm->lbasize,
+               return nd_size_select_show(nspm->lbasize,
                                pmem_lbasize_supported, buf);
        }
        return -ENXIO;
@@ -1352,7 +1352,7 @@ static ssize_t sector_size_store(struct device *dev,
        if (to_ndns(dev)->claim)
                rc = -EBUSY;
        if (rc >= 0)
-               rc = nd_sector_size_store(dev, buf, lbasize, supported);
+               rc = nd_size_select_store(dev, buf, lbasize, supported);
        if (rc >= 0)
                rc = nd_namespace_label_update(nd_region, dev);
        dev_dbg(dev, "%s: result: %zd %s: %s%s", __func__,
index a08fc2e24fb3be4f1aaf56547b5aa65cfa9abb34..251c7e6d2588ed0a50222649b1dd12fa7bf31fa0 100644 (file)
@@ -234,10 +234,10 @@ void nd_device_unregister(struct device *dev, enum nd_async_mode mode);
 void nd_device_notify(struct device *dev, enum nvdimm_event event);
 int nd_uuid_store(struct device *dev, u8 **uuid_out, const char *buf,
                size_t len);
-ssize_t nd_sector_size_show(unsigned long current_lbasize,
+ssize_t nd_size_select_show(unsigned long current_size,
                const unsigned long *supported, char *buf);
-ssize_t nd_sector_size_store(struct device *dev, const char *buf,
-               unsigned long *current_lbasize, const unsigned long *supported);
+ssize_t nd_size_select_store(struct device *dev, const char *buf,
+               unsigned long *current_size, const unsigned long *supported);
 int __init nvdimm_init(void);
 int __init nd_region_init(void);
 int __init nd_label_init(void);