Skip to content

Commit 24493b8

Browse files
lsgunthChristoph Hellwig
authored andcommitted
nvme: export nvme_find_get_ns() and nvme_put_ns()
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 <[email protected]> Signed-off-by: Logan Gunthorpe <[email protected]> Reviewed-by: Keith Busch <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent f783f44 commit 24493b8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,11 @@ static void nvme_free_ns(struct kref *kref)
465465
kfree(ns);
466466
}
467467

468-
static void nvme_put_ns(struct nvme_ns *ns)
468+
void nvme_put_ns(struct nvme_ns *ns)
469469
{
470470
kref_put(&ns->kref, nvme_free_ns);
471471
}
472+
EXPORT_SYMBOL_NS_GPL(nvme_put_ns, NVME_TARGET_PASSTHRU);
472473

473474
static inline void nvme_clear_nvme_request(struct request *req)
474475
{
@@ -3827,7 +3828,7 @@ static int ns_cmp(void *priv, struct list_head *a, struct list_head *b)
38273828
return nsa->head->ns_id - nsb->head->ns_id;
38283829
}
38293830

3830-
static struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid)
3831+
struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid)
38313832
{
38323833
struct nvme_ns *ns, *ret = NULL;
38333834

@@ -3845,6 +3846,7 @@ static struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid)
38453846
up_read(&ctrl->namespaces_rwsem);
38463847
return ret;
38473848
}
3849+
EXPORT_SYMBOL_NS_GPL(nvme_find_get_ns, NVME_TARGET_PASSTHRU);
38483850

38493851
static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
38503852
{

drivers/nvme/host/nvme.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,5 +794,7 @@ u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
794794
u8 opcode);
795795
void nvme_execute_passthru_rq(struct request *rq);
796796
struct nvme_ctrl *nvme_ctrl_get_by_path(const char *path);
797+
struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid);
798+
void nvme_put_ns(struct nvme_ns *ns);
797799

798800
#endif /* _NVME_H */

0 commit comments

Comments
 (0)