nvme: cache struct nvme_ctrl reference to struct nvme_request
We will need to reference the controller in the setup and completion time for tracing and future traffic based keep alive support. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
202093848c
commit
59e29ce66b
5 changed files with 6 additions and 0 deletions
|
@ -1737,6 +1737,7 @@ nvme_fc_init_request(struct blk_mq_tag_set *set, struct request *rq,
|
|||
int queue_idx = (set == &ctrl->tag_set) ? hctx_idx + 1 : 0;
|
||||
struct nvme_fc_queue *queue = &ctrl->queues[queue_idx];
|
||||
|
||||
nvme_req(rq)->ctrl = &ctrl->ctrl;
|
||||
return __nvme_fc_init_request(ctrl, queue, op, rq, queue->rqcnt++);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ struct nvme_request {
|
|||
u8 retries;
|
||||
u8 flags;
|
||||
u16 status;
|
||||
struct nvme_ctrl *ctrl;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -418,6 +418,8 @@ static int nvme_init_request(struct blk_mq_tag_set *set, struct request *req,
|
|||
|
||||
BUG_ON(!nvmeq);
|
||||
iod->nvmeq = nvmeq;
|
||||
|
||||
nvme_req(req)->ctrl = &dev->ctrl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -288,6 +288,7 @@ static int nvme_rdma_init_request(struct blk_mq_tag_set *set,
|
|||
struct ib_device *ibdev = dev->dev;
|
||||
int ret;
|
||||
|
||||
nvme_req(rq)->ctrl = &ctrl->ctrl;
|
||||
ret = nvme_rdma_alloc_qe(ibdev, &req->sqe, sizeof(struct nvme_command),
|
||||
DMA_TO_DEVICE);
|
||||
if (ret)
|
||||
|
|
|
@ -227,6 +227,7 @@ static int nvme_loop_init_request(struct blk_mq_tag_set *set,
|
|||
{
|
||||
struct nvme_loop_ctrl *ctrl = set->driver_data;
|
||||
|
||||
nvme_req(req)->ctrl = &ctrl->ctrl;
|
||||
return nvme_loop_init_iod(ctrl, blk_mq_rq_to_pdu(req),
|
||||
(set == &ctrl->tag_set) ? hctx_idx + 1 : 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue