aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme/target/core.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/core.c
parentnvmet: looks at the passthrough controller when initializing CAP (diff)
downloadlinux-dev-ab7a2737ac5acd7d485ca45d8772497717fbc781.tar.xz
linux-dev-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 'drivers/nvme/target/core.c')
-rw-r--r--drivers/nvme/target/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 11c44706dc2d..b8425fa34300 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -553,7 +553,7 @@ int nvmet_ns_enable(struct nvmet_ns *ns)
mutex_lock(&subsys->lock);
ret = 0;
- if (nvmet_passthru_ctrl(subsys)) {
+ if (nvmet_is_passthru_subsys(subsys)) {
pr_info("cannot enable both passthru and regular namespaces for a single subsystem");
goto out_unlock;
}
@@ -869,7 +869,7 @@ static u16 nvmet_parse_io_cmd(struct nvmet_req *req)
if (unlikely(ret))
return ret;
- if (nvmet_req_passthru_ctrl(req))
+ if (nvmet_is_passthru_req(req))
return nvmet_parse_passthru_io_cmd(req);
ret = nvmet_req_find_ns(req);
@@ -1207,7 +1207,7 @@ static void nvmet_init_cap(struct nvmet_ctrl *ctrl)
/* maximum queue entries supported: */
ctrl->cap |= NVMET_QUEUE_SIZE - 1;
- if (nvmet_passthru_ctrl(ctrl->subsys))
+ if (nvmet_is_passthru_subsys(ctrl->subsys))
nvmet_passthrough_override_cap(ctrl);
}