Commit 62b83b18 authored by Christoph Hellwig's avatar Christoph Hellwig

nvme-loop: merge init_request methods

Now that we get the tagset passed we can have a single implementation for
the I/O and admin queues.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 76f983cb
...@@ -232,15 +232,10 @@ static int nvme_loop_init_request(struct blk_mq_tag_set *set, ...@@ -232,15 +232,10 @@ static int nvme_loop_init_request(struct blk_mq_tag_set *set,
struct request *req, unsigned int hctx_idx, struct request *req, unsigned int hctx_idx,
unsigned int numa_node) unsigned int numa_node)
{ {
return nvme_loop_init_iod(set->driver_data, blk_mq_rq_to_pdu(req), struct nvme_loop_ctrl *ctrl = set->driver_data;
hctx_idx + 1);
}
static int nvme_loop_init_admin_request(struct blk_mq_tag_set *set, return nvme_loop_init_iod(ctrl, blk_mq_rq_to_pdu(req),
struct request *req, unsigned int hctx_idx, (set == &ctrl->tag_set) ? hctx_idx + 1 : 0);
unsigned int numa_node)
{
return nvme_loop_init_iod(set->driver_data, blk_mq_rq_to_pdu(req), 0);
} }
static int nvme_loop_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, static int nvme_loop_init_hctx(struct blk_mq_hw_ctx *hctx, void *data,
...@@ -278,7 +273,7 @@ static const struct blk_mq_ops nvme_loop_mq_ops = { ...@@ -278,7 +273,7 @@ static const struct blk_mq_ops nvme_loop_mq_ops = {
static const struct blk_mq_ops nvme_loop_admin_mq_ops = { static const struct blk_mq_ops nvme_loop_admin_mq_ops = {
.queue_rq = nvme_loop_queue_rq, .queue_rq = nvme_loop_queue_rq,
.complete = nvme_loop_complete_rq, .complete = nvme_loop_complete_rq,
.init_request = nvme_loop_init_admin_request, .init_request = nvme_loop_init_request,
.init_hctx = nvme_loop_init_admin_hctx, .init_hctx = nvme_loop_init_admin_hctx,
.timeout = nvme_loop_timeout, .timeout = nvme_loop_timeout,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment