[RFC PATCH 17/21] dasd: use lib tagset init helper

From: Chaitanya Kulkarni
Date: Tue Oct 04 2022 - 23:30:54 EST


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@xxxxxxxxxx>
---
drivers/s390/block/dasd_genhd.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 998a961e1704..a7c55b7e5f6d 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -48,12 +48,9 @@ int dasd_gendisk_alloc(struct dasd_block *block)
if (base->devindex >= DASD_PER_MAJOR)
return -EBUSY;

- block->tag_set.ops = &dasd_mq_ops;
- block->tag_set.cmd_size = sizeof(struct dasd_ccw_req);
- block->tag_set.nr_hw_queues = nr_hw_queues;
- block->tag_set.queue_depth = queue_depth;
- block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
- block->tag_set.numa_node = NUMA_NO_NODE;
+ blk_mq_alloc_tag_set(&block->tag_set, &dasd_mq_ops, nr_hw_queues,
+ queue_depth, sizeof(struct dasd_ccw_req), NUMA_NO_NODE,
+ 0, BLK_MQ_F_SHOULD_MERGE, NULL);
rc = blk_mq_alloc_tag_set(&block->tag_set);
if (rc)
return rc;
--
2.29.0