summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/target/passthru.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-08-27 08:11:12 +0200
committerChristoph Hellwig <hch@lst.de>2021-09-06 09:59:03 +0200
commitab7a2737ac5acd7d485ca45d8772497717fbc781 (patch)
tree0885bee4e8fedcdce6e32d6d3d66c853aa7d8bbd /drivers/nvme/target/passthru.c
parentnvmet: looks at the passthrough controller when initializing CAP (diff)
downloadlinux-ab7a2737ac5acd7d485ca45d8772497717fbc781.tar.xz
linux-ab7a2737ac5acd7d485ca45d8772497717fbc781.zip
nvmet: return bool from nvmet_passthru_ctrl and nvmet_is_passthru_req
The target core code never needs the host-side nvme_ctrl structure. Open code two uses of nvmet_is_passthru_req in passthru.c, and then switch the helpers used by the core to return bool. Also rename the fuctions to better match their usage: nvmet_passthru_ctrl -> nvmet_is_passthru_subsys nvmet_req_passthru_ctrl -> nvmet_is_passthru_req Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to '')
-rw-r--r--drivers/nvme/target/passthru.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c
index 8784c487e462..f0efb3537989 100644
--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -228,7 +228,7 @@ static int nvmet_passthru_map_sg(struct nvmet_req *req, struct request *rq)
static void nvmet_passthru_execute_cmd(struct nvmet_req *req)
{
- struct nvme_ctrl *ctrl = nvmet_req_passthru_ctrl(req);
+ struct nvme_ctrl *ctrl = nvmet_req_subsys(req)->passthru_ctrl;
struct request_queue *q = ctrl->admin_q;
struct nvme_ns *ns = NULL;
struct request *rq = NULL;
@@ -309,7 +309,7 @@ out:
*/
static void nvmet_passthru_set_host_behaviour(struct nvmet_req *req)
{
- struct nvme_ctrl *ctrl = nvmet_req_passthru_ctrl(req);
+ struct nvme_ctrl *ctrl = nvmet_req_subsys(req)->passthru_ctrl;
struct nvme_feat_host_behavior *host;
u16 status = NVME_SC_INTERNAL;
int ret;