Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2346779ybh; Fri, 24 Jul 2020 10:27:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSa83XJYToc1qVyFJ4FwAiWceLrzyZNsypF7+T8jifHSXm4YQ/ePEvq68gUtymvZhHxaGp X-Received: by 2002:a17:907:20f8:: with SMTP id rh24mr9817201ejb.309.1595611636263; Fri, 24 Jul 2020 10:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595611636; cv=none; d=google.com; s=arc-20160816; b=JPazRKF2/q46DfWiwwYHyL3qrsTVvEpzOmxJ1j0+qx50E6TYMihvTfKqs0PLWcsXnr 7cukWaXGkprefRl7FQEVe0pTTF1e6TkpgJ3tWN2WbMcq+STUMCX1WW2Ks30vORlPpSbF LO5Nv/Yt/tATAxyMIoi/CA3lKD5xTZIE5bRJ2tmNWpvrzIKcV2g3+I5jJpQ3ltodtA2f UpoL0Aqz7l2zMZTA79xIqy+Cwzcw+XQZ456P7SYcWzOfnqvm+G/E2vVtjJ0WepA6IbKH RyfdVb4OA11FaPT6JNGEtPhO0RbD4sXrTRVi79LUVFzxZm0CqGUF+65ULjUzlmqQJKKz qJkw== 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 :mime-version:references:in-reply-to:message-id:date:cc:to:from :dkim-signature; bh=8NDho9EykBONaEANrlThsHbP82tdStup5GK3jtapJB0=; b=koYr0pqO6OAPCI1POMJkiFDcQ9URDKWZuHy3htySktwWP4J4QhVOJ/AMpkkbMocWO6 46DDw6o4P1Ihkg15uNh3IVh9tgs6uVkPXdvY0s+D5rY7MgEv8zZkXhYgfXWKlVsPSGVr fJg8l662mMZVmoATWHTAbTKjwggrBNqaitH9mVOubvxt0HGJgt+iSUZYFuc6yfmeXNFD oNu9f63NO8Hua89OD6lMuvIJxzQI+ABwb2VGs/ghk5fZUQU2hq+SUPHnjD1oJcJSKcZm 6ew3Dy1B2zOEjjt7q/bSRwgC6PvLhSxgFtheVMdseTK+ondoF8NoW+WSLWca2iUo7Nyb wHuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@deltatee.com header.s=20200525 header.b=fY5Z8Gjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yh22si1033297ejb.62.2020.07.24.10.26.54; Fri, 24 Jul 2020 10:27:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@deltatee.com header.s=20200525 header.b=fY5Z8Gjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgGXRZo (ORCPT + 99 others); Fri, 24 Jul 2020 13:25:44 -0400 Received: from ale.deltatee.com ([204.191.154.188]:58686 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbgGXRZg (ORCPT ); Fri, 24 Jul 2020 13:25:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8NDho9EykBONaEANrlThsHbP82tdStup5GK3jtapJB0=; b=fY5Z8GjfRNPYA0Vvktf8k1n3nO cncPYeKs2b+Rlss2x43DvlLNw+eYTAGzH5B3NZhw/aeiIuLc8YXmOjPU38aMLDe3+1/jAcj7X16EL hBaOzaLrdUxeHTgcKQ6gcxxCNhKp9U8kuwUX4pHLZiD6fvMwMhWkn5p1i/M3nkr502JE99OcaACsp SWy2HoJKyY7t/mszcs5ROa82qoTntTfjD0DCGqd3IsKQjVWI6cA5HoyRIDyftZMY4BuSlZP9dm3dh aIGykFNC+WGSYow1sabswX29SK/RlnpE3SykEFS2fbIpuMKNX0awi+HqhXzgQJOh1eD9OCf6JDhup TLiDzzlA==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jz1Rs-0006ym-6V; Fri, 24 Jul 2020 11:25:34 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1jz1Ri-0004GI-DN; Fri, 24 Jul 2020 11:25:22 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Christoph Hellwig , Sagi Grimberg , Keith Busch , Jens Axboe , Chaitanya Kulkarni , Max Gurtovoy , Stephen Bates , Logan Gunthorpe , Chaitanya Kulkarni Date: Fri, 24 Jul 2020 11:25:16 -0600 Message-Id: <20200724172520.16318-6-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724172520.16318-1-logang@deltatee.com> References: <20200724172520.16318-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me, kbusch@kernel.org, axboe@fb.com, maxg@mellanox.com, sbates@raithlin.com, logang@deltatee.com, Chaitanya.Kulkarni@wdc.com, chaitanya.kulkarni@wdc.com X-SA-Exim-Mail-From: gunthorp@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.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_FREE,MYRULES_NO_TEXT,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Subject: [PATCH v16 5/9] nvme: Export nvme_find_get_ns() and nvme_put_ns() 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 nvme_find_get_ns() and nvme_put_ns() are required by the target passthru code and are exported under the NVME_TARGET_PASSTHRU namespace. Based-on-a-patch-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe --- drivers/nvme/host/core.c | 6 ++++-- drivers/nvme/host/nvme.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 35b1d13db2e9..4db336066ef0 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -454,10 +454,11 @@ 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); } +EXPORT_SYMBOL_NS_GPL(nvme_put_ns, NVME_TARGET_PASSTHRU); static inline void nvme_clear_nvme_request(struct request *req) { @@ -3815,7 +3816,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; @@ -3833,6 +3834,7 @@ static struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid) up_read(&ctrl->namespaces_rwsem); return ret; } +EXPORT_SYMBOL_NS_GPL(nvme_find_get_ns, NVME_TARGET_PASSTHRU); static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) { diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 4bec44ab5a96..ed45ee91f5d6 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -788,5 +788,7 @@ u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u8 opcode); void nvme_execute_passthru_rq(struct request *rq); struct nvme_ctrl *nvme_ctrl_get_by_path(const char *path); +struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid); +void nvme_put_ns(struct nvme_ns *ns); #endif /* _NVME_H */ -- 2.20.1