diff options
| author | Simon A. F. Lund <slund@cnexlabs.com> | 2016-05-06 14:03:02 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@fb.com> | 2016-05-06 14:51:10 -0400 |
| commit | 6063fe399d0913e7bd4462650cd4f31b479a83c9 (patch) | |
| tree | a03964afaef6422de511c1377d518f887efa00fd /drivers/lightnvm | |
| parent | 909049a7199947abbc6a923e4cf5cff1857d4205 (diff) | |
lightnvm: rename nvm_targets to nvm_tgt_type
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>
Diffstat (limited to 'drivers/lightnvm')
| -rw-r--r-- | drivers/lightnvm/core.c | 16 | ||||
| -rw-r--r-- | drivers/lightnvm/rrpc.c | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 74fb049e0b83..240b4731c35e 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | #include <linux/sched/sysctl.h> | 30 | #include <linux/sched/sysctl.h> |
| 31 | #include <uapi/linux/lightnvm.h> | 31 | #include <uapi/linux/lightnvm.h> |
| 32 | 32 | ||
| 33 | static LIST_HEAD(nvm_targets); | 33 | static LIST_HEAD(nvm_tgt_types); |
| 34 | static LIST_HEAD(nvm_mgrs); | 34 | static LIST_HEAD(nvm_mgrs); |
| 35 | static LIST_HEAD(nvm_devices); | 35 | static LIST_HEAD(nvm_devices); |
| 36 | static DECLARE_RWSEM(nvm_lock); | 36 | static DECLARE_RWSEM(nvm_lock); |
| @@ -39,14 +39,14 @@ static struct nvm_tgt_type *nvm_find_target_type(const char *name) | |||
| 39 | { | 39 | { |
| 40 | struct nvm_tgt_type *tt; | 40 | struct nvm_tgt_type *tt; |
| 41 | 41 | ||
| 42 | list_for_each_entry(tt, &nvm_targets, list) | 42 | list_for_each_entry(tt, &nvm_tgt_types, list) |
| 43 | if (!strcmp(name, tt->name)) | 43 | if (!strcmp(name, tt->name)) |
| 44 | return tt; | 44 | return tt; |
| 45 | 45 | ||
| 46 | return NULL; | 46 | return NULL; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | int nvm_register_target(struct nvm_tgt_type *tt) | 49 | int nvm_register_tgt_type(struct nvm_tgt_type *tt) |
| 50 | { | 50 | { |
| 51 | int ret = 0; | 51 | int ret = 0; |
| 52 | 52 | ||
| @@ -54,14 +54,14 @@ int nvm_register_target(struct nvm_tgt_type *tt) | |||
| 54 | if (nvm_find_target_type(tt->name)) | 54 | if (nvm_find_target_type(tt->name)) |
| 55 | ret = -EEXIST; | 55 | ret = -EEXIST; |
| 56 | else | 56 | else |
| 57 | list_add(&tt->list, &nvm_targets); | 57 | list_add(&tt->list, &nvm_tgt_types); |
| 58 | up_write(&nvm_lock); | 58 | up_write(&nvm_lock); |
| 59 | 59 | ||
| 60 | return ret; | 60 | return ret; |
| 61 | } | 61 | } |
| 62 | EXPORT_SYMBOL(nvm_register_target); | 62 | EXPORT_SYMBOL(nvm_register_tgt_type); |
| 63 | 63 | ||
| 64 | void nvm_unregister_target(struct nvm_tgt_type *tt) | 64 | void nvm_unregister_tgt_type(struct nvm_tgt_type *tt) |
| 65 | { | 65 | { |
| 66 | if (!tt) | 66 | if (!tt) |
| 67 | return; | 67 | return; |
| @@ -70,7 +70,7 @@ void nvm_unregister_target(struct nvm_tgt_type *tt) | |||
| 70 | list_del(&tt->list); | 70 | list_del(&tt->list); |
| 71 | up_write(&nvm_lock); | 71 | up_write(&nvm_lock); |
| 72 | } | 72 | } |
| 73 | EXPORT_SYMBOL(nvm_unregister_target); | 73 | EXPORT_SYMBOL(nvm_unregister_tgt_type); |
| 74 | 74 | ||
| 75 | void *nvm_dev_dma_alloc(struct nvm_dev *dev, gfp_t mem_flags, | 75 | void *nvm_dev_dma_alloc(struct nvm_dev *dev, gfp_t mem_flags, |
| 76 | dma_addr_t *dma_handler) | 76 | dma_addr_t *dma_handler) |
| @@ -1020,7 +1020,7 @@ static long nvm_ioctl_info(struct file *file, void __user *arg) | |||
| 1020 | info->version[2] = NVM_VERSION_PATCH; | 1020 | info->version[2] = NVM_VERSION_PATCH; |
| 1021 | 1021 | ||
| 1022 | down_write(&nvm_lock); | 1022 | down_write(&nvm_lock); |
| 1023 | list_for_each_entry(tt, &nvm_targets, list) { | 1023 | list_for_each_entry(tt, &nvm_tgt_types, list) { |
| 1024 | struct nvm_ioctl_info_tgt *tgt = &info->tgts[tgt_iter]; | 1024 | struct nvm_ioctl_info_tgt *tgt = &info->tgts[tgt_iter]; |
| 1025 | 1025 | ||
| 1026 | tgt->version[0] = tt->version[0]; | 1026 | tgt->version[0] = tt->version[0]; |
diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index 3143b980ac06..c7fef71f4276 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c | |||
| @@ -1469,12 +1469,12 @@ static struct nvm_tgt_type tt_rrpc = { | |||
| 1469 | 1469 | ||
| 1470 | static int __init rrpc_module_init(void) | 1470 | static int __init rrpc_module_init(void) |
| 1471 | { | 1471 | { |
| 1472 | return nvm_register_target(&tt_rrpc); | 1472 | return nvm_register_tgt_type(&tt_rrpc); |
| 1473 | } | 1473 | } |
| 1474 | 1474 | ||
| 1475 | static void rrpc_module_exit(void) | 1475 | static void rrpc_module_exit(void) |
| 1476 | { | 1476 | { |
| 1477 | nvm_unregister_target(&tt_rrpc); | 1477 | nvm_unregister_tgt_type(&tt_rrpc); |
| 1478 | } | 1478 | } |
| 1479 | 1479 | ||
| 1480 | module_init(rrpc_module_init); | 1480 | module_init(rrpc_module_init); |
