diff mbox series

blk-mq: Always use blk_mq_is_sbitmap_shared

Message ID 20210311081713.2763171-1-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series blk-mq: Always use blk_mq_is_sbitmap_shared | expand

Commit Message

Nikolay Borisov March 11, 2021, 8:17 a.m. UTC
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 block/blk-mq-tag.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Johannes Thumshirn March 11, 2021, 8:25 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Nikolay Borisov April 6, 2021, 7:07 a.m. UTC | #2
On 11.03.21 г. 10:17, Nikolay Borisov wrote:
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Ping

> ---
>  block/blk-mq-tag.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> index 9c92053e704d..99bc5fe14e9b 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -517,7 +517,7 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
>  	tags->nr_tags = total_tags;
>  	tags->nr_reserved_tags = reserved_tags;
>  
> -	if (flags & BLK_MQ_F_TAG_HCTX_SHARED)
> +	if (blk_mq_is_sbitmap_shared(flags))
>  		return tags;
>  
>  	if (blk_mq_init_bitmap_tags(tags, node, alloc_policy) < 0) {
> @@ -529,7 +529,7 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
>  
>  void blk_mq_free_tags(struct blk_mq_tags *tags, unsigned int flags)
>  {
> -	if (!(flags & BLK_MQ_F_TAG_HCTX_SHARED)) {
> +	if (!blk_mq_is_sbitmap_shared(flags)) {
>  		sbitmap_queue_free(tags->bitmap_tags);
>  		sbitmap_queue_free(tags->breserved_tags);
>  	}
>
Hannes Reinecke April 6, 2021, 7:20 a.m. UTC | #3
On 3/11/21 9:17 AM, Nikolay Borisov wrote:
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>   block/blk-mq-tag.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> index 9c92053e704d..99bc5fe14e9b 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -517,7 +517,7 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
>   	tags->nr_tags = total_tags;
>   	tags->nr_reserved_tags = reserved_tags;
>   
> -	if (flags & BLK_MQ_F_TAG_HCTX_SHARED)
> +	if (blk_mq_is_sbitmap_shared(flags))
>   		return tags;
>   
>   	if (blk_mq_init_bitmap_tags(tags, node, alloc_policy) < 0) {
> @@ -529,7 +529,7 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
>   
>   void blk_mq_free_tags(struct blk_mq_tags *tags, unsigned int flags)
>   {
> -	if (!(flags & BLK_MQ_F_TAG_HCTX_SHARED)) {
> +	if (!blk_mq_is_sbitmap_shared(flags)) {
>   		sbitmap_queue_free(tags->bitmap_tags);
>   		sbitmap_queue_free(tags->breserved_tags);
>   	}
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Himanshu Madhani April 6, 2021, 2:36 p.m. UTC | #4
> On Mar 11, 2021, at 2:17 AM, Nikolay Borisov <nborisov@suse.com> wrote:
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> block/blk-mq-tag.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> index 9c92053e704d..99bc5fe14e9b 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -517,7 +517,7 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
> 	tags->nr_tags = total_tags;
> 	tags->nr_reserved_tags = reserved_tags;
> 
> -	if (flags & BLK_MQ_F_TAG_HCTX_SHARED)
> +	if (blk_mq_is_sbitmap_shared(flags))
> 		return tags;
> 
> 	if (blk_mq_init_bitmap_tags(tags, node, alloc_policy) < 0) {
> @@ -529,7 +529,7 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
> 
> void blk_mq_free_tags(struct blk_mq_tags *tags, unsigned int flags)
> {
> -	if (!(flags & BLK_MQ_F_TAG_HCTX_SHARED)) {
> +	if (!blk_mq_is_sbitmap_shared(flags)) {
> 		sbitmap_queue_free(tags->bitmap_tags);
> 		sbitmap_queue_free(tags->breserved_tags);
> 	}
> -- 
> 2.25.1
> 

Looks Good. 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering
Jens Axboe April 6, 2021, 3:24 p.m. UTC | #5
On 3/11/21 1:17 AM, Nikolay Borisov wrote:
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 9c92053e704d..99bc5fe14e9b 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -517,7 +517,7 @@  struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
 	tags->nr_tags = total_tags;
 	tags->nr_reserved_tags = reserved_tags;
 
-	if (flags & BLK_MQ_F_TAG_HCTX_SHARED)
+	if (blk_mq_is_sbitmap_shared(flags))
 		return tags;
 
 	if (blk_mq_init_bitmap_tags(tags, node, alloc_policy) < 0) {
@@ -529,7 +529,7 @@  struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
 
 void blk_mq_free_tags(struct blk_mq_tags *tags, unsigned int flags)
 {
-	if (!(flags & BLK_MQ_F_TAG_HCTX_SHARED)) {
+	if (!blk_mq_is_sbitmap_shared(flags)) {
 		sbitmap_queue_free(tags->bitmap_tags);
 		sbitmap_queue_free(tags->breserved_tags);
 	}