mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Matias Bjørling" <m@bjorling.me>
To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com
Cc: "Simon A. F. Lund" <slund@cnexlabs.com>,
	"Matias Bjørling" <m@bjorling.me>
Subject: [PATCH 09/28] lightnvm: rename nvm_targets to nvm_tgt_type
Date: Fri,  6 May 2016 20:03:02 +0200	[thread overview]
Message-ID: <1462557801-24974-10-git-send-email-m@bjorling.me> (raw)
In-Reply-To: <1462557801-24974-1-git-send-email-m@bjorling.me>

From: "Simon A. F. Lund" <slund@cnexlabs.com>

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>
---
 drivers/lightnvm/core.c  | 16 ++++++++--------
 drivers/lightnvm/rrpc.c  |  4 ++--
 include/linux/lightnvm.h |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 74fb049..240b473 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -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];
diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index 3143b98..c7fef71 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -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);
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index dacaa28..497da91 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -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);
-- 
2.1.4

  parent reply	other threads:[~2016-05-06 18:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 18:02 [PATCH 00/28] LightNVM fixes for 4.7 Matias Bjørling
2016-05-06 18:02 ` [PATCH 01/28] lightnvm: fix "warning: ‘ret’ may be used uninitialized" Matias Bjørling
2016-05-06 18:02 ` [PATCH 02/28] lightnvm: handle submit_io failure Matias Bjørling
2016-05-06 18:02 ` [PATCH 03/28] lightnvm: implement nvm_submit_ppa_list Matias Bjørling
2016-05-06 18:02 ` [PATCH 04/28] lightnvm: add fpg_size and pfpg_size to struct nvm_dev Matias Bjørling
2016-05-06 18:02 ` [PATCH 05/28] lightnvm: move block fold outside of get_bb_tbl() Matias Bjørling
2016-05-06 18:02 ` [PATCH 06/28] lightnvm: avoid memory leak when lun_map kcalloc fails Matias Bjørling
2016-05-06 18:03 ` [PATCH 07/28] lightnvm: calculate rrpc total blocks and sectors up front Matias Bjørling
2016-05-06 18:03 ` [PATCH 08/28] lightnvm: store rrpc->soffset in device sector size Matias Bjørling
2016-05-06 18:03 ` Matias Bjørling [this message]
2016-05-06 18:03 ` [PATCH 10/28] lightnvm: refactor dev->online_target to global nvm_targets Matias Bjørling
2016-05-06 18:03 ` [PATCH 11/28] lightnvm: introduce nvm_for_each_lun_ppa() macro Matias Bjørling
2016-05-06 18:03 ` [PATCH 12/28] lightnvm: refactor device ops->get_bb_tbl() Matias Bjørling
2016-05-06 18:03 ` [PATCH 13/28] lightnvm: remove struct factory_blks Matias Bjørling
2016-05-06 18:03 ` [PATCH 14/28] lightnvm: make nvm_set_rqd_ppalist() aware of vblks Matias Bjørling
2016-05-06 18:03 ` [PATCH 15/28] lightnvm: move responsibility for bad blk mgmt to target Matias Bjørling
2016-05-06 18:03 ` [PATCH 16/28] lightnvm: refactor set_bb_tbl for accepting ppa list Matias Bjørling
2016-05-06 18:03 ` [PATCH 17/28] lightnvm: fix out of bound ppa lun id on bb tbl Matias Bjørling
2016-05-06 18:03 ` [PATCH 18/28] lightnvm: do not free unused metadata on rrpc Matias Bjørling
2016-05-06 18:03 ` [PATCH 19/28] lightnvm: enable metadata to be sent to device Matias Bjørling
2016-05-06 18:03 ` [PATCH 20/28] lightnvm: rename dma helper functions Matias Bjørling
2016-05-06 18:03 ` [PATCH 21/28] nvme/lightnvm: Log using the ctrl named device Matias Bjørling
2016-05-06 18:03 ` [PATCH 22/28] lightnvm: do not assume sequential lun alloc Matias Bjørling
2016-05-06 18:03 ` [PATCH 23/28] lightnvm: pass dma address to hardware rather than pointer Matias Bjørling
2016-05-06 18:03 ` [PATCH 24/28] lightnvm: remove mgt targets on mgt removal Matias Bjørling
2016-05-06 18:03 ` [PATCH 25/28] lightnvm: expose gennvm_mark_blk to targets Matias Bjørling
2016-05-06 18:03 ` [PATCH 26/28] lightnvm: add is_cached entry to struct ppa_addr Matias Bjørling
2016-05-06 18:03 ` [PATCH 27/28] lightnvm: rename nr_pages to nr_ppas on nvm_rq Matias Bjørling
2016-05-06 18:03 ` [PATCH 28/28] lightnvm: reserved space calculation incorrect Matias Bjørling
2016-05-10 14:43 ` [PATCH 00/28] LightNVM fixes for 4.7 Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462557801-24974-10-git-send-email-m@bjorling.me \
    --to=m@bjorling.me \
    --cc=axboe@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slund@cnexlabs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®