Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp1209379pjo; Wed, 8 Jan 2020 13:52:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzYsgF0An6ItIRTGTKzgpZ7OiPwqnnXN/6vET0li4mHVdTIQfqcynlHTO4WgPLtY9YSWNNH X-Received: by 2002:aca:481:: with SMTP id 123mr633795oie.110.1578520330119; Wed, 08 Jan 2020 13:52:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578520330; cv=none; d=google.com; s=arc-20160816; b=bTz+8/nTyCCytjBtCG0gYWsi1ylztkpCsgHEjCOkJkbqUW1Q6GXEd4llu92vnYEo3q aazCGkPOkD5YI+YgkHTKXylaut8jTIHQ4E6+uOH1yRgIpCupnBgMTjWP5LXoCuPZboem jIZFLX0COcc4CAMlP9uXy1sfQV0XC17KIVKMpgzHwzpglOz8avdPV1d4B+tVmXcqrBLQ 0KXkF0dScZ8aGRM2gCvalNjq7J9IajK/Wxl3d0mkIYj3DimnWuRZ4fG1vtbIXFWzuOHw tz/wxpI2LUrS8VOFqLBTQJRP/6Qq7V2z+QSe7W2uJqCcggoeGYPmQTxhcWffOtH+0yD6 z9iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=Nr6x9IFUxaIvUtKirsqFU5L8ShSuNGNtCuiQ8UFp5T8=; b=h37Ux1cjeJCt6s9GZMP2E+0LPgFljBJVYM30l4J3ud/7s/Bz6aB225XZe5l3SsIVAQ qGMK26vixxRec40KunaQmHzvJnpk3q+hClgQjKV1w4s4JirWJLIMUbTpe4/mzLMtfwDU pNErzqc2Vj/OxM45GPcZSfHbe0KnfkUDkD+qJffAqVvJ+gKORGcwINq+ulvKu6jgiYar hMELoDHcOId5wohaR2R+IsyxfBzXI7CYsXNIwmBwse4FV6bR96s+eQ10f1t9VcTrHMTe mlB2Gh0UFbkTB+oM9BBLTa0mBvRpT3fg1ZPWxD3SkWyxfzbh2LxuXAJydNktbqPKJmCE bBEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u84si2361361oib.34.2020.01.08.13.51.57; Wed, 08 Jan 2020 13:52:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727249AbgAHVuf (ORCPT + 99 others); Wed, 8 Jan 2020 16:50:35 -0500 Received: from ale.deltatee.com ([207.54.116.67]:50166 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgAHVuf (ORCPT ); Wed, 8 Jan 2020 16:50:35 -0500 Received: from s0106ac1f6bb1ecac.cg.shawcable.net ([70.73.163.230] helo=[192.168.11.155]) by ale.deltatee.com with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ipJDT-00014M-FT; Wed, 08 Jan 2020 14:50:16 -0700 To: Max Gurtovoy , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Jens Axboe , Keith Busch , Christoph Hellwig References: <20200108174030.3430-1-logang@deltatee.com> <20200108174030.3430-7-logang@deltatee.com> <707b39a3-b58a-44b7-7ffa-0c2bd3f28e21@mellanox.com> From: Logan Gunthorpe Message-ID: <2d8a1cc2-be58-176e-b12b-8dbc5dab8739@deltatee.com> Date: Wed, 8 Jan 2020 14:50:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <707b39a3-b58a-44b7-7ffa-0c2bd3f28e21@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.73.163.230 X-SA-Exim-Rcpt-To: hch@lst.de, kbusch@kernel.org, axboe@fb.com, sbates@raithlin.com, chaitanya.kulkarni@wdc.com, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, maxg@mellanox.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_FREE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH v10 6/9] nvme: Export existing nvme core functions X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-08 2:48 p.m., Max Gurtovoy wrote: > > On 1/8/2020 7:40 PM, Logan Gunthorpe wrote: >> Export nvme_put_ns(), nvme_command_effects(), nvme_execute_passthru_rq() >> and nvme_find_get_ns() for use in the nvmet passthru code. >> >> The exports are conditional on CONFIG_NVME_TARGET_PASSTHRU. >> >> Based-on-a-patch-by: Chaitanya Kulkarni >> Signed-off-by: Logan Gunthorpe >> --- >>   drivers/nvme/host/core.c | 14 +++++++++----- >>   drivers/nvme/host/nvme.h |  5 +++++ >>   2 files changed, 14 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c >> index d7912e7a9911..037415882d46 100644 >> --- a/drivers/nvme/host/core.c >> +++ b/drivers/nvme/host/core.c >> @@ -463,7 +463,7 @@ static void nvme_free_ns(struct kref *kref) >>       kfree(ns); >>   } >>   -static void nvme_put_ns(struct nvme_ns *ns) >> +void nvme_put_ns(struct nvme_ns *ns) >>   { >>       kref_put(&ns->kref, nvme_free_ns); >>   } >> @@ -896,8 +896,8 @@ static void *nvme_add_user_metadata(struct bio >> *bio, void __user *ubuf, >>       return ERR_PTR(ret); >>   } >>   -static u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct >> nvme_ns *ns, >> -                u8 opcode) >> +u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns, >> +             u8 opcode) >>   { >>       u32 effects = 0; >>   @@ -982,7 +982,7 @@ static void nvme_passthru_end(struct nvme_ctrl >> *ctrl, u32 effects) >>           nvme_queue_scan(ctrl); >>   } >>   -static void nvme_execute_passthru_rq(struct request *rq) >> +void nvme_execute_passthru_rq(struct request *rq) >>   { >>       struct nvme_command *cmd = nvme_req(rq)->cmd; >>       struct nvme_ctrl *ctrl = nvme_req(rq)->ctrl; >> @@ -3441,7 +3441,7 @@ static int ns_cmp(void *priv, struct list_head >> *a, struct list_head *b) >>       return nsa->head->ns_id - nsb->head->ns_id; >>   } >>   -static struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, >> unsigned nsid) >> +struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid) >>   { >>       struct nvme_ns *ns, *ret = NULL; >>   @@ -4225,6 +4225,10 @@ EXPORT_SYMBOL_GPL(nvme_sync_queues); >>    * use by the nvmet-passthru and should not be used for >>    * other things. >>    */ >> +EXPORT_SYMBOL_GPL(nvme_put_ns); >> +EXPORT_SYMBOL_GPL(nvme_command_effects); >> +EXPORT_SYMBOL_GPL(nvme_execute_passthru_rq); >> +EXPORT_SYMBOL_GPL(nvme_find_get_ns); > > Since this is the convention in the driver, can you export the symbols > at the end of each function ? Christoph specifically asked for these to be exported at the end of the file within an #ifdef CONFIG_NVME_TARGET_PASSTHRU. Logan