aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMinwoo Im2020-12-05 00:20:53 +0900
committerJens Axboe2020-12-12 11:13:41 -0700
commit91cdf265b74bf63a69949d6db08a60523207400c (patch)
tree1e1faf486127067ff0357525570e7b876e6be746 /block
parent7aa390ec2d9db0cd6677d95d0b8f307f9c086770 (diff)
blk-mq: add helper allocating tagset->tags
tagset->set is allocated from blk_mq_alloc_tag_set() rather than being reallocated. This patch added a helper to make its meaning explicitly which is to allocate rather than to reallocate. Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 95ecc4c69969..e2bd9ef81d55 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3382,6 +3382,12 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
return 0;
}
+static int blk_mq_alloc_tag_set_tags(struct blk_mq_tag_set *set,
+ int new_nr_hw_queues)
+{
+ return blk_mq_realloc_tag_set_tags(set, 0, new_nr_hw_queues);
+}
+
/*
* Alloc a tag set to be associated with one or more request queues.
* May fail with EINVAL for various error conditions. May adjust the
@@ -3435,7 +3441,7 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
if (set->nr_maps == 1 && set->nr_hw_queues > nr_cpu_ids)
set->nr_hw_queues = nr_cpu_ids;
- if (blk_mq_realloc_tag_set_tags(set, 0, set->nr_hw_queues) < 0)
+ if (blk_mq_alloc_tag_set_tags(set, set->nr_hw_queues) < 0)
return -ENOMEM;
ret = -ENOMEM;