diff mbox series

[RFC,5/6] nvme-core: use init alloc tagset helper

Message ID 20221010170026.49808-6-kch@nvidia.com (mailing list archive)
State New, archived
Headers show
Series block: add and use tagset init helper | expand

Commit Message

Chaitanya Kulkarni Oct. 10, 2022, 5 p.m. UTC
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/nvme/host/core.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 965a4c3e9d44..bb6868f895c3 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4814,17 +4814,13 @@  int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
 	int ret;
 
 	memset(set, 0, sizeof(*set));
-	set->ops = ops;
-	set->queue_depth = NVME_AQ_MQ_TAG_DEPTH;
 	if (ctrl->ops->flags & NVME_F_FABRICS)
 		set->reserved_tags = NVMF_RESERVED_TAGS;
 	set->numa_node = ctrl->numa_node;
 	set->flags = flags;
 	set->cmd_size = cmd_size;
-	set->driver_data = ctrl;
-	set->nr_hw_queues = 1;
 	set->timeout = NVME_ADMIN_TIMEOUT;
-	ret = blk_mq_alloc_tag_set(set);
+	ret = blk_mq_init_alloc_tag_set(set, ops, 1, NVME_AQ_MQ_TAG_DEPTH, ctrl);
 	if (ret)
 		return ret;
 
@@ -4869,18 +4865,15 @@  int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
 	int ret;
 
 	memset(set, 0, sizeof(*set));
-	set->ops = ops;
-	set->queue_depth = ctrl->sqsize + 1;
 	set->reserved_tags = NVMF_RESERVED_TAGS;
 	set->numa_node = ctrl->numa_node;
 	set->flags = flags;
 	set->cmd_size = cmd_size,
-	set->driver_data = ctrl;
-	set->nr_hw_queues = ctrl->queue_count - 1;
 	set->timeout = NVME_IO_TIMEOUT;
 	if (ops->map_queues)
 		set->nr_maps = ctrl->opts->nr_poll_queues ? HCTX_MAX_TYPES : 2;
-	ret = blk_mq_alloc_tag_set(set);
+	ret = blk_mq_init_alloc_tag_set(set, ops, ctrl->queue_count - 1,
+			ctrl->sqsize + 1, ctrl);
 	if (ret)
 		return ret;