diff mbox series

[RFC,09/21] block: use lib tagset init helper

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

Commit Message

Chaitanya Kulkarni Oct. 5, 2022, 3:22 a.m. UTC
Use the block layer helper to initialize the common fields of tag_set
such as blk_mq_ops, number of h/w queues, queue depth, command size,
numa_node, timeout, BLK_MQ_F_XXX flags, driver data. This initialization
is spread all over the block drivers. This avoids the code repetation of
the inialization code of the tag set in current block drivers and any
future ones.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 block/blk-mq.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index e3a8dd81bbe2..d4cb5c44a53d 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4455,12 +4455,9 @@  int blk_mq_alloc_sq_tag_set(struct blk_mq_tag_set *set,
 		unsigned int set_flags)
 {
 	memset(set, 0, sizeof(*set));
-	set->ops = ops;
-	set->nr_hw_queues = 1;
+	blk_mq_init_tag_set(set, ops, 1, queue_depth, 0, NUMA_NO_NODE, 0,
+			set_flags, NULL);
 	set->nr_maps = 1;
-	set->queue_depth = queue_depth;
-	set->numa_node = NUMA_NO_NODE;
-	set->flags = set_flags;
 	return blk_mq_alloc_tag_set(set);
 }
 EXPORT_SYMBOL_GPL(blk_mq_alloc_sq_tag_set);