[RFC PATCH 13/21] z3ram: use lib tagset init helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/block/z2ram.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index c1e85f356e4d..b381d652d911 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -351,12 +351,9 @@ static int __init z2_init(void)
 	if (register_blkdev(Z2RAM_MAJOR, DEVICE_NAME))
 		return -EBUSY;
 
-	tag_set.ops = &z2_mq_ops;
-	tag_set.nr_hw_queues = 1;
 	tag_set.nr_maps = 1;
-	tag_set.queue_depth = 16;
-	tag_set.numa_node = NUMA_NO_NODE;
-	tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
+	blk_mq_init_tag_set(&tag_set, &z2_mq_ops, 1, 18, 0, NUMA_NO_NODE, 0,
+			BLK_MQ_F_SHOULD_MERGE, NULL);
 	ret = blk_mq_alloc_tag_set(&tag_set);
 	if (ret)
 		goto out_unregister_blkdev;
-- 
2.29.0




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux