lightnvm: rename nvm_targets to nvm_tgt_type
authorSimon A. F. Lund <slund@cnexlabs.com>
Fri, 6 May 2016 18:03:02 +0000 (20:03 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 6 May 2016 18:51:10 +0000 (12:51 -0600)
The functions nvm_register_target(), nvm_unregister_target() and
associated list refers to a target type that is being registered by a
target type module. Rename nvm_*_targets() to nvm_*_tgt_type(), so that
the intension is clear.

This enables target instances to use the _nvm_*_targets() naming.

Signed-off-by: Simon A. F. Lund <slund@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/core.c
drivers/lightnvm/rrpc.c
include/linux/lightnvm.h

index 74fb049e0b83629313a3cba35be7906271199b11..240b4731c35e85a92711dc69c2fad7703be22c88 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/sched/sysctl.h>
 #include <uapi/linux/lightnvm.h>
 
-static LIST_HEAD(nvm_targets);
+static LIST_HEAD(nvm_tgt_types);
 static LIST_HEAD(nvm_mgrs);
 static LIST_HEAD(nvm_devices);
 static DECLARE_RWSEM(nvm_lock);
@@ -39,14 +39,14 @@ static struct nvm_tgt_type *nvm_find_target_type(const char *name)
 {
        struct nvm_tgt_type *tt;
 
-       list_for_each_entry(tt, &nvm_targets, list)
+       list_for_each_entry(tt, &nvm_tgt_types, list)
                if (!strcmp(name, tt->name))
                        return tt;
 
        return NULL;
 }
 
-int nvm_register_target(struct nvm_tgt_type *tt)
+int nvm_register_tgt_type(struct nvm_tgt_type *tt)
 {
        int ret = 0;
 
@@ -54,14 +54,14 @@ int nvm_register_target(struct nvm_tgt_type *tt)
        if (nvm_find_target_type(tt->name))
                ret = -EEXIST;
        else
-               list_add(&tt->list, &nvm_targets);
+               list_add(&tt->list, &nvm_tgt_types);
        up_write(&nvm_lock);
 
        return ret;
 }
-EXPORT_SYMBOL(nvm_register_target);
+EXPORT_SYMBOL(nvm_register_tgt_type);
 
-void nvm_unregister_target(struct nvm_tgt_type *tt)
+void nvm_unregister_tgt_type(struct nvm_tgt_type *tt)
 {
        if (!tt)
                return;
@@ -70,7 +70,7 @@ void nvm_unregister_target(struct nvm_tgt_type *tt)
        list_del(&tt->list);
        up_write(&nvm_lock);
 }
-EXPORT_SYMBOL(nvm_unregister_target);
+EXPORT_SYMBOL(nvm_unregister_tgt_type);
 
 void *nvm_dev_dma_alloc(struct nvm_dev *dev, gfp_t mem_flags,
                                                        dma_addr_t *dma_handler)
@@ -1020,7 +1020,7 @@ static long nvm_ioctl_info(struct file *file, void __user *arg)
        info->version[2] = NVM_VERSION_PATCH;
 
        down_write(&nvm_lock);
-       list_for_each_entry(tt, &nvm_targets, list) {
+       list_for_each_entry(tt, &nvm_tgt_types, list) {
                struct nvm_ioctl_info_tgt *tgt = &info->tgts[tgt_iter];
 
                tgt->version[0] = tt->version[0];
index 3143b980ac06d7a1bb70a847491bbeac467c1aee..c7fef71f4276683b2d51d0d2e8e3905e94e1a3ec 100644 (file)
@@ -1469,12 +1469,12 @@ static struct nvm_tgt_type tt_rrpc = {
 
 static int __init rrpc_module_init(void)
 {
-       return nvm_register_target(&tt_rrpc);
+       return nvm_register_tgt_type(&tt_rrpc);
 }
 
 static void rrpc_module_exit(void)
 {
-       nvm_unregister_target(&tt_rrpc);
+       nvm_unregister_tgt_type(&tt_rrpc);
 }
 
 module_init(rrpc_module_init);
index dacaa28504287156a4556f65e195d8dfa6d32564..497da91510b259552153c33672269154f46cbdb1 100644 (file)
@@ -453,8 +453,8 @@ struct nvm_tgt_type {
        struct list_head list;
 };
 
-extern int nvm_register_target(struct nvm_tgt_type *);
-extern void nvm_unregister_target(struct nvm_tgt_type *);
+extern int nvm_register_tgt_type(struct nvm_tgt_type *);
+extern void nvm_unregister_tgt_type(struct nvm_tgt_type *);
 
 extern void *nvm_dev_dma_alloc(struct nvm_dev *, gfp_t, dma_addr_t *);
 extern void nvm_dev_dma_free(struct nvm_dev *, void *, dma_addr_t);