Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759802AbcDMMbF (ORCPT ); Wed, 13 Apr 2016 08:31:05 -0400 Received: from mail-by2on0062.outbound.protection.outlook.com ([207.46.100.62]:2112 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759324AbcDMMbB (ORCPT ); Wed, 13 Apr 2016 08:31:01 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cnexlabs.com; From: "Simon A. F. Lund" To: , , CC: "Simon A. F. Lund" Subject: [PATCH 1/2] lightnvm: rename nvm_targets to nvm_tgt_type Date: Wed, 13 Apr 2016 14:15:33 +0200 Message-ID: <1460549734-844-2-git-send-email-slund@cnexlabs.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460549734-844-1-git-send-email-slund@cnexlabs.com> References: <1460549734-844-1-git-send-email-slund@cnexlabs.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [193.106.164.198] X-ClientProxiedBy: DB4PR07CA015.eurprd07.prod.outlook.com (10.242.229.25) To CO2PR0601MB0983.namprd06.prod.outlook.com (10.160.7.28) X-MS-Office365-Filtering-Correlation-Id: 291f6edc-1fa9-49a0-f5f2-08d363955fa6 X-Microsoft-Exchange-Diagnostics: 1;CO2PR0601MB0983;2:Gckv/DcABt34Lr8pSaOB5ToAZFYZ897OI0xgyWpnN9uaNsH1kJbxoE4ltN5RRGbHXf+G/D4EQZZZUhF8mlKOm0K6/0PZ/ZBZyN2iP7iPovuwIRd7P+Cwm1za5lqLDhXpGE7wm5sHs9UfH2Mc8nWIn2CozyYQgXDA8mJ2TDUYIdNIVyNrD0SnQLIkVdJRu4kW;3:iO/g8e9pWjBRdQgTYNHaA/LeO4uZixHtF+js37d87reqF17L7l3QSCqIvXlT2AhkpmJ0KngHHUp+imtHmvVyvRW1qOzu96Gz5SKFEzWER+Azr0nlp7966X5Tp3K5P1y4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR0601MB0983; X-Microsoft-Exchange-Diagnostics: 1;CO2PR0601MB0983;25:Lh/ceD/KVxSUbqQcTl7QBkn2lT/PGGwo5dUybry9vfFjvfEcOCOGLSSTMZ/hllw87fZDYm4CwcXoMrvWohn11GZij1j+EXbuG+Zmxmmz1vGMqFP64Pl6IXslIuAtSES4LzG7E4Mnv4ZC97OxuxkjLUWewevYfmjjbrUpPBIdINF0948l9rBpIHzOIMnu3EcKt2kcEAXJ76nvPbSm8oxzRURBrTjleeiQBKiGUnoBDbspTU7vHitR/dMZMeismIDVputkZWRQ1K7fepv55LWYAPlHwIlxwdihR5UU4j3gpcFxh/p9TH1uDT8kPlyNEIU8Sq65tDI9PlHh0LXWMOlLUQCUhNzVyZei66vRwsgQMWg9Ndn+IS5RtGUY8T7dsUmceUlHi/v7FgDhFCZ1aSSr+ptFpt9yFZ3R1XjnCva86mbl0VDZ3oDs9guZvGpz0ByDP8E8J8hV3XjTr4S4X8O8jhUFpRrL1ucmgohVBxzVUoiNrlrZIIXZfzeBZLP6mBldoTjs9qvd2xdIZYGcRSeDjnovPXZoGcUeJqs0v6f+ItoKSaaFoLt4q/TtDyXioJTzs180U/3iBjulmMDHN6EWYY+YpqO0ftaOlELiFr7jXuCIHPxfeoSc8PxrHmu4XjaqHctX6Uzc6tgihyQHdAmGoA==;20:GVoah7SN4mtGECOiMWVhWAKaDtGup6DmFzJ3KXWbnR4YHMhSHF/jWXgXYcvPlxmNeV8sd07wUf/x1wOn2DSao8LuxoknhdW+tqaTk5DCBJ16Y9DWDVM7kws+VOJU4vQk29hb5Nx2zi1X4gI89ZD+9xESWD4qyqvNNFUd8c6jk0c= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040074)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041046)(6043046);SRVR:CO2PR0601MB0983;BCL:0;PCL:0;RULEID:;SRVR:CO2PR0601MB0983; X-Microsoft-Exchange-Diagnostics: 1;CO2PR0601MB0983;4:dlOLCt0dkwQctgB1OQvai3jrJ1KvV5nvobiA8ylydaHxGPP/rcZVpC1ehHEYXQla1ugF6GB41/VRIuFmlI+nQOUqnWpMN2eSpPOdQWGVnQ2ryu0AGDodqTwZyZDBDifTH2RY9J1zzU5htpE5VR4+WwnHDf/O1WLXIeVQHONnEzc1XgQxzYkVKmda3/D0ileEoHLUVS3UiEBfWRjmginPRG7vLADJJO0bZKJ8JQ/A+MFBg2hwTSyrOwjWY2u7c/Yh0u1tl1kLPuMFMUusopdDJtslGKuqv+s60XkJCyFLkqggFFBqQBGDMIdkjT1r++iTQrEKcz4tDQBrYZ4Vh4P1jh7OTwhykkybtvOp6Phfszx646YuSvIK/ufh/496cpN5hAfYmaPp05MBI9CZMwcdD2YJbr08cCpS4yRg+p5Bvy4= X-Forefront-PRVS: 0911D5CE78 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(2906002)(77096005)(48376002)(5004730100002)(6116002)(586003)(2950100001)(5001770100001)(229853001)(50466002)(81166005)(5008740100001)(33646002)(86362001)(47776003)(19580395003)(36756003)(66066001)(189998001)(2201001)(19580405001)(92566002)(50986999)(76176999)(4326007)(107886002)(53416004)(42186005)(1096002)(50226001)(4001430100002);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR0601MB0983;H:tiger.cnexlabs.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CO2PR0601MB0983;23:Iipjpp1PoIXb8KRdwBhfj3H6zV9as0f5jpGAk914chZdsiWwu8dmmBb81qvnTgRdWscMdKZgZRBiUwTxKpWM5urpNt0gWpoVwstqT6SEw7i9N5XfbM3k0FGlu02e2EAudHXsGeC4sWuUujjEJLDcuoIlSVew7kWBtZfoMvXvnCHJceVeeonoMVGS+jU1QUFx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ata: NSPM X-OriginatorOrg: cnexlabs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2016 12:15:58.4957 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR0601MB0983 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3557 Lines: 116 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 --- 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 #include -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 3ab6495..4625e9c 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -1468,12 +1468,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.5.0