diff options
author | Christoph Hellwig <hch@lst.de> | 2022-11-09 11:08:10 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-11-10 11:18:09 -0700 |
commit | 5ee20298ff25e883d0668507b3216992a2e9e6cd (patch) | |
tree | 1e23d762a994b60eda28135c48705f4c4cb003c3 /block | |
parent | 99771d73ff4539f2337b84917f4792abf0d8931b (diff) |
blk-mq: remove blk_mq_alloc_tag_set_tags
There is no point in trying to share any code with the realloc case when
all that is needed by the initial tagset allocation is a simple
kcalloc_node.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20221109100811.2413423-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index fc9c400adf92..0134a1dd854f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4398,12 +4398,6 @@ 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 @@ -4466,11 +4460,13 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) goto out_free_srcu; } - ret = blk_mq_alloc_tag_set_tags(set, set->nr_hw_queues); - if (ret) + ret = -ENOMEM; + set->tags = kcalloc_node(set->nr_hw_queues, + sizeof(struct blk_mq_tags *), GFP_KERNEL, + set->numa_node); + if (!set->tags) goto out_cleanup_srcu; - ret = -ENOMEM; for (i = 0; i < set->nr_maps; i++) { set->map[i].mq_map = kcalloc_node(nr_cpu_ids, sizeof(set->map[i].mq_map[0]), |