Skip to content

Commit 6887fc6

Browse files
sagigrimbergChristoph Hellwig
authored andcommitted
nvme: introduce nvme_start_request
In preparation for nvme-multipath IO stats accounting, we want the accounting to happen in a centralized place. The request completion is already centralized, but we need a common helper to request I/O start. Signed-off-by: Sagi Grimberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Keith Busch <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
1 parent 99722c8 commit 6887fc6

File tree

7 files changed

+11
-6
lines changed

7 files changed

+11
-6
lines changed

drivers/nvme/host/apple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static blk_status_t apple_nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
763763
goto out_free_cmd;
764764
}
765765

766-
blk_mq_start_request(req);
766+
nvme_start_request(req);
767767
apple_nvme_submit_cmd(q, cmnd);
768768
return BLK_STS_OK;
769769

drivers/nvme/host/fc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2733,7 +2733,7 @@ nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,
27332733
atomic_set(&op->state, FCPOP_STATE_ACTIVE);
27342734

27352735
if (!(op->flags & FCOP_FLAGS_AEN))
2736-
blk_mq_start_request(op->rq);
2736+
nvme_start_request(op->rq);
27372737

27382738
cmdiu->csn = cpu_to_be32(atomic_inc_return(&queue->csn));
27392739
ret = ctrl->lport->ops->fcp_io(&ctrl->lport->localport,

drivers/nvme/host/nvme.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,11 @@ static inline void nvme_hwmon_exit(struct nvme_ctrl *ctrl)
10121012
}
10131013
#endif
10141014

1015+
static inline void nvme_start_request(struct request *rq)
1016+
{
1017+
blk_mq_start_request(rq);
1018+
}
1019+
10151020
static inline bool nvme_ctrl_sgl_supported(struct nvme_ctrl *ctrl)
10161021
{
10171022
return ctrl->sgls & ((1 << 0) | (1 << 1));

drivers/nvme/host/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ static blk_status_t nvme_prep_rq(struct nvme_dev *dev, struct request *req)
907907
goto out_unmap_data;
908908
}
909909

910-
blk_mq_start_request(req);
910+
nvme_start_request(req);
911911
return BLK_STS_OK;
912912
out_unmap_data:
913913
nvme_unmap_data(dev, req);

drivers/nvme/host/rdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ static blk_status_t nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx,
20402040
if (ret)
20412041
goto unmap_qe;
20422042

2043-
blk_mq_start_request(rq);
2043+
nvme_start_request(rq);
20442044

20452045
if (IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY) &&
20462046
queue->pi_support &&

drivers/nvme/host/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2405,7 +2405,7 @@ static blk_status_t nvme_tcp_queue_rq(struct blk_mq_hw_ctx *hctx,
24052405
if (unlikely(ret))
24062406
return ret;
24072407

2408-
blk_mq_start_request(rq);
2408+
nvme_start_request(rq);
24092409

24102410
nvme_tcp_queue_request(req, true, bd->last);
24112411

drivers/nvme/target/loop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static blk_status_t nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx,
145145
if (ret)
146146
return ret;
147147

148-
blk_mq_start_request(req);
148+
nvme_start_request(req);
149149
iod->cmd.common.flags |= NVME_CMD_SGL_METABUF;
150150
iod->req.port = queue->ctrl->port;
151151
if (!nvmet_req_init(&iod->req, &queue->nvme_cq,

0 commit comments

Comments
 (0)