From patchwork Fri May 6 18:03:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 9035561 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3DA71BF29F for ; Fri, 6 May 2016 18:11:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2088220398 for ; Fri, 6 May 2016 18:11:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16D5E200E9 for ; Fri, 6 May 2016 18:11:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758733AbcEFSDq (ORCPT ); Fri, 6 May 2016 14:03:46 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36442 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758604AbcEFSDn (ORCPT ); Fri, 6 May 2016 14:03:43 -0400 Received: by mail-wm0-f49.google.com with SMTP id n129so67104368wmn.1 for ; Fri, 06 May 2016 11:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zkSc554Kk5lt6GqOdX56SW91hxqhaAWW+UZMuDNbvNs=; b=VWXP0kvbW93HpRQHUnzOOaS0jal0v2LCfKOavyic1uliWKmm9NDmcOUDOVOgSpSt3G S45FILDCW0CaHFXEW/uvDQUvqI/WIrYhtnaItxG99+bJE0DsHzDyFdkAgitKYDMkZAxb GNpu8QEvQtogJDbheqTBihYpLH/jtIK6MWve4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zkSc554Kk5lt6GqOdX56SW91hxqhaAWW+UZMuDNbvNs=; b=HzOrGC+eFmq1HmmjDDrz7XAEwyj5t6O5CslM0vs7Ep2pXvpkgxp3azK8C2j1TCSDPd KYjviA48XNnvCWYmpDYGHBon0IVoDSdEipTZ3ZVBoV1lZ2glRmB2v53ppw+V+a0nP+/9 JYTdk7uNug5ERSh0EScjAnYYBqrDg691Fid75PgNLWoPxQAsYcsn/Seo+Ny7l3EHQpoF BkVHSXaP5HUEWGWwg7Ts+jEYuitMAZuyiMfpX7b+iwOrnU12uj3jussi1TrSrLtrKXEn feu8yrt8TvjXJhTL0fd7dom2QmBD5eIJXIBz1kEZW8hzEJbwpK4W6N+SPTMmSE2doEKL YBAw== X-Gm-Message-State: AOPr4FVKQoQ4A0uX118osF+raidVp/1gU2naInN9dGDwuDJ36vT0KGJfW+lcvsyaeDPliA== X-Received: by 10.194.105.230 with SMTP id gp6mr20695448wjb.90.1462557822090; Fri, 06 May 2016 11:03:42 -0700 (PDT) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id kz1sm16076559wjc.46.2016.05.06.11.03.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 May 2016 11:03:41 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: "Simon A. F. Lund" , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 09/28] lightnvm: rename nvm_targets to nvm_tgt_type Date: Fri, 6 May 2016 20:03:02 +0200 Message-Id: <1462557801-24974-10-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462557801-24974-1-git-send-email-m@bjorling.me> References: <1462557801-24974-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Simon A. F. Lund" 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 Signed-off-by: Matias Bjørling --- 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 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);