Skip to content

Commit 91cdf26

Browse files
minwooimaxboe
authored andcommitted
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 7aa390e commit 91cdf26

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

block/blk-mq.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3382,6 +3382,12 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
33823382
return 0;
33833383
}
33843384

3385+
static int blk_mq_alloc_tag_set_tags(struct blk_mq_tag_set *set,
3386+
int new_nr_hw_queues)
3387+
{
3388+
return blk_mq_realloc_tag_set_tags(set, 0, new_nr_hw_queues);
3389+
}
3390+
33853391
/*
33863392
* Alloc a tag set to be associated with one or more request queues.
33873393
* 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)
34353441
if (set->nr_maps == 1 && set->nr_hw_queues > nr_cpu_ids)
34363442
set->nr_hw_queues = nr_cpu_ids;
34373443

3438-
if (blk_mq_realloc_tag_set_tags(set, 0, set->nr_hw_queues) < 0)
3444+
if (blk_mq_alloc_tag_set_tags(set, set->nr_hw_queues) < 0)
34393445
return -ENOMEM;
34403446

34413447
ret = -ENOMEM;

0 commit comments

Comments
 (0)