diff mbox series

blk-mq: remove blk_mq_alloc_tag_set_tags

Message ID 20221107061706.1269999-1-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series blk-mq: remove blk_mq_alloc_tag_set_tags | expand

Commit Message

Christoph Hellwig Nov. 7, 2022, 6:17 a.m. UTC
This is a trivial wrapper with a single caller, so remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-mq.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Chaitanya Kulkarni Nov. 8, 2022, 3:47 a.m. UTC | #1
On 11/6/22 22:17, Christoph Hellwig wrote:
> This is a trivial wrapper with a single caller, so remove it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   block/blk-mq.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
> 

I thought of it when doing blk_mq_init_alloc_tag_set() RFC :).

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck
Jens Axboe Nov. 8, 2022, 4:20 a.m. UTC | #2
On 11/6/22 11:17 PM, Christoph Hellwig wrote:
> This is a trivial wrapper with a single caller, so remove it.

Getting rid of the helper is nice, but the realloc one is badly
named imho. Can we rename that while at it? There are only 1
caller after this anyway.
Christoph Hellwig Nov. 8, 2022, 6:20 a.m. UTC | #3
On Mon, Nov 07, 2022 at 09:20:37PM -0700, Jens Axboe wrote:
> Getting rid of the helper is nice, but the realloc one is badly
> named imho. Can we rename that while at it? There are only 1
> caller after this anyway.

Tell me your preferred name and I'll do it.
Jens Axboe Nov. 8, 2022, 2:16 p.m. UTC | #4
On 11/7/22 11:20 PM, Christoph Hellwig wrote:
> On Mon, Nov 07, 2022 at 09:20:37PM -0700, Jens Axboe wrote:
>> Getting rid of the helper is nice, but the realloc one is badly
>> named imho. Can we rename that while at it? There are only 1
>> caller after this anyway.
> 
> Tell me your preferred name and I'll do it.

Just call it blk_mq_alloc_tag_set_tags() at least and get rid of the
realloc? Should make the patch simpler too.
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 7ff3415c8eadc..d26238f0de323 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4403,12 +4403,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
@@ -4471,7 +4465,7 @@  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);
+	ret = blk_mq_realloc_tag_set_tags(set, 0, set->nr_hw_queues);
 	if (ret)
 		goto out_cleanup_srcu;