From: Logan Gunthorpe <logang@deltatee.com> To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>, Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>, Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>, Max Gurtovoy <maxg@mellanox.com>, Stephen Bates <sbates@raithlin.com>, Logan Gunthorpe <logang@deltatee.com>, Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Subject: [PATCH v16 5/9] nvme: Export nvme_find_get_ns() and nvme_put_ns() Date: Fri, 24 Jul 2020 11:25:16 -0600 [thread overview] Message-ID: <20200724172520.16318-6-logang@deltatee.com> (raw) In-Reply-To: <20200724172520.16318-1-logang@deltatee.com> 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 <chaitanya.kulkarni@wdc.com> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> --- 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
WARNING: multiple messages have this Message-ID (diff)
From: Logan Gunthorpe <logang@deltatee.com> To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Sagi Grimberg <sagi@grimberg.me>, Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>, Stephen Bates <sbates@raithlin.com>, Jens Axboe <axboe@fb.com>, Keith Busch <kbusch@kernel.org>, Max Gurtovoy <maxg@mellanox.com>, Logan Gunthorpe <logang@deltatee.com>, Christoph Hellwig <hch@lst.de> Subject: [PATCH v16 5/9] nvme: Export nvme_find_get_ns() and nvme_put_ns() Date: Fri, 24 Jul 2020 11:25:16 -0600 [thread overview] Message-ID: <20200724172520.16318-6-logang@deltatee.com> (raw) In-Reply-To: <20200724172520.16318-1-logang@deltatee.com> 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 <chaitanya.kulkarni@wdc.com> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> --- 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 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-07-24 17:25 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-24 17:25 [PATCH v16 0/9] nvmet: add target passthru commands support Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe 2020-07-24 17:25 ` [PATCH v16 1/9] nvme-core: Clear any SGL flags in passthru commands Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe 2020-07-24 17:25 ` [PATCH v16 2/9] nvme: Create helper function to obtain command effects Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe 2020-07-24 17:25 ` [PATCH v16 3/9] nvme: Introduce nvme_execute_passthru_rq to call nvme_passthru_[start|end]() Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe 2020-07-24 17:25 ` [PATCH v16 4/9] nvme-core: Introduce nvme_ctrl_get_by_path() Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe [this message] 2020-07-24 17:25 ` [PATCH v16 5/9] nvme: Export nvme_find_get_ns() and nvme_put_ns() Logan Gunthorpe 2020-07-24 17:25 ` [PATCH v16 6/9] nvmet-passthru: Add passthru code to process commands Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe 2020-07-24 19:33 ` Keith Busch 2020-07-24 19:33 ` Keith Busch 2020-07-24 19:40 ` Logan Gunthorpe 2020-07-24 19:40 ` Logan Gunthorpe 2020-07-26 15:41 ` Christoph Hellwig 2020-07-26 15:41 ` Christoph Hellwig 2020-07-27 15:44 ` Logan Gunthorpe 2020-07-27 15:44 ` Logan Gunthorpe 2020-07-24 17:25 ` [PATCH v16 7/9] nvmet-passthru: Add enable/disable helpers Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe 2020-07-24 17:25 ` [PATCH v16 8/9] nvmet-configfs: Introduce passthru configfs interface Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe 2020-07-24 17:25 ` [PATCH v16 9/9] nvmet-passthru: Introduce NVMet passthru Kconfig option Logan Gunthorpe 2020-07-24 17:25 ` Logan Gunthorpe 2020-07-24 19:35 ` [PATCH v16 0/9] nvmet: add target passthru commands support Keith Busch 2020-07-24 19:35 ` Keith Busch
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=20200724172520.16318-6-logang@deltatee.com \ --to=logang@deltatee.com \ --cc=Chaitanya.Kulkarni@wdc.com \ --cc=axboe@fb.com \ --cc=hch@lst.de \ --cc=kbusch@kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-nvme@lists.infradead.org \ --cc=maxg@mellanox.com \ --cc=sagi@grimberg.me \ --cc=sbates@raithlin.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.