[PATCH 08/14] blk-mq: add blk_mq_resize_tag_set()

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

 



Add a function to resize the number of tags in an existing tag set.

Signed-off-by: Hannes Reinecke <hare@xxxxxxxx>
---
 block/blk-mq.c         | 15 +++++++++++++++
 include/linux/blk-mq.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 29cbc1b..e2afe45 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2385,6 +2385,21 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues)
 }
 EXPORT_SYMBOL_GPL(blk_mq_update_nr_hw_queues);
 
+int blk_mq_resize_tag_set(struct blk_mq_tag_set *set, int new_tags)
+{
+	int i, ret = 0;
+
+	for (i = 0; i < set->nr_hw_queues; i++) {
+		if (!set->tags[i])
+			continue;
+		ret = blk_mq_tag_update_depth(set->tags[i], new_tags);
+		if (ret)
+			break;
+	}
+	return ret;
+}
+EXPORT_SYMBOL(blk_mq_resize_tag_set);
+
 void blk_mq_disable_hotplug(void)
 {
 	mutex_lock(&all_q_mutex);
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 2498fdf..8b603b6 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -181,6 +181,7 @@ void blk_mq_unregister_disk(struct gendisk *);
 
 int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set);
 void blk_mq_free_tag_set(struct blk_mq_tag_set *set);
+int blk_mq_resize_tag_set(struct blk_mq_tag_set *set, int new_tags);
 
 void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule);
 
-- 
1.8.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux