diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2021-02-09 21:48:01 -0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-02-10 16:38:05 +0100 |
commit | 20c2c3bb83f26c42bf62cc773f96f30848ed11a2 (patch) | |
tree | 9e4995e67f373f99dd23d9bcec7f34fc241146c3 /drivers/nvme/target/core.c | |
parent | d86481e924a7d6e8a40477ffa98077c6c0d77ed5 (diff) | |
download | linux-20c2c3bb83f26c42bf62cc773f96f30848ed11a2.tar.bz2 |
nvmet: add nvmet_req_subsys() helper
Just like what we have to get the passthru ctrl from the req, add an
helper to get the subsystem associated with the nvmet_req() instead
of open coding the chain of structures.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target/core.c')
-rw-r--r-- | drivers/nvme/target/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 35ad96261b8f..7e3b194203a4 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -430,7 +430,7 @@ u16 nvmet_req_find_ns(struct nvmet_req *req) { u32 nsid = le32_to_cpu(req->cmd->common.nsid); - req->ns = xa_load(&req->sq->ctrl->subsys->namespaces, nsid); + req->ns = xa_load(&nvmet_req_subsys(req)->namespaces, nsid); if (unlikely(!req->ns)) { req->error_loc = offsetof(struct nvme_common_command, nsid); return NVME_SC_INVALID_NS | NVME_SC_DNR; |