* [PATCH] blk-mq-tag: make blk_mq_tag_busy() return void
@ 2020-12-08 7:40 Xianting Tian
2020-12-10 4:00 ` Ming Lei
0 siblings, 1 reply; 3+ messages in thread
From: Xianting Tian @ 2020-12-08 7:40 UTC (permalink / raw)
To: axboe; +Cc: linux-block, linux-kernel, Xianting Tian
As no one cares about the return value of blk_mq_tag_busy() and
__blk_mq_tag_busy(), so make them return void.
Signed-off-by: Xianting Tian <tian.xianting@h3c.com>
---
block/blk-mq-tag.c | 4 ++--
block/blk-mq-tag.h | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 9c92053e7..21ff7d156 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -21,7 +21,7 @@
* to get tag when first time, the other shared-tag users could reserve
* budget for it.
*/
-bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
+void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
{
if (blk_mq_is_sbitmap_shared(hctx->flags)) {
struct request_queue *q = hctx->queue;
@@ -36,7 +36,7 @@ bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
atomic_inc(&hctx->tags->active_queues);
}
- return true;
+ return;
}
/*
diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h
index 7d3e6b333..dd80e5a85 100644
--- a/block/blk-mq-tag.h
+++ b/block/blk-mq-tag.h
@@ -60,15 +60,15 @@ enum {
BLK_MQ_TAG_MAX = BLK_MQ_NO_TAG - 1,
};
-extern bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *);
+extern void __blk_mq_tag_busy(struct blk_mq_hw_ctx *);
extern void __blk_mq_tag_idle(struct blk_mq_hw_ctx *);
-static inline bool blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
+static inline void blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
{
if (!(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED))
- return false;
+ return;
- return __blk_mq_tag_busy(hctx);
+ __blk_mq_tag_busy(hctx);
}
static inline void blk_mq_tag_idle(struct blk_mq_hw_ctx *hctx)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] blk-mq-tag: make blk_mq_tag_busy() return void
2020-12-08 7:40 [PATCH] blk-mq-tag: make blk_mq_tag_busy() return void Xianting Tian
@ 2020-12-10 4:00 ` Ming Lei
2020-12-10 4:08 ` Tianxianting
0 siblings, 1 reply; 3+ messages in thread
From: Ming Lei @ 2020-12-10 4:00 UTC (permalink / raw)
To: Xianting Tian; +Cc: axboe, linux-block, linux-kernel
On Tue, Dec 08, 2020 at 03:40:02PM +0800, Xianting Tian wrote:
> As no one cares about the return value of blk_mq_tag_busy() and
> __blk_mq_tag_busy(), so make them return void.
>
> Signed-off-by: Xianting Tian <tian.xianting@h3c.com>
> ---
> block/blk-mq-tag.c | 4 ++--
> block/blk-mq-tag.h | 8 ++++----
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> index 9c92053e7..21ff7d156 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -21,7 +21,7 @@
> * to get tag when first time, the other shared-tag users could reserve
> * budget for it.
> */
> -bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> +void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> {
> if (blk_mq_is_sbitmap_shared(hctx->flags)) {
> struct request_queue *q = hctx->queue;
> @@ -36,7 +36,7 @@ bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> atomic_inc(&hctx->tags->active_queues);
> }
>
> - return true;
> + return;
> }
>
> /*
> diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h
> index 7d3e6b333..dd80e5a85 100644
> --- a/block/blk-mq-tag.h
> +++ b/block/blk-mq-tag.h
> @@ -60,15 +60,15 @@ enum {
> BLK_MQ_TAG_MAX = BLK_MQ_NO_TAG - 1,
> };
>
> -extern bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *);
> +extern void __blk_mq_tag_busy(struct blk_mq_hw_ctx *);
> extern void __blk_mq_tag_idle(struct blk_mq_hw_ctx *);
>
> -static inline bool blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> +static inline void blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> {
> if (!(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED))
> - return false;
> + return;
>
> - return __blk_mq_tag_busy(hctx);
> + __blk_mq_tag_busy(hctx);
The above can be simplified as:
if (hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED)
__blk_mq_tag_busy(hctx);
Otherwise, looks fine:
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Thanks,
Ming
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] blk-mq-tag: make blk_mq_tag_busy() return void
2020-12-10 4:00 ` Ming Lei
@ 2020-12-10 4:08 ` Tianxianting
0 siblings, 0 replies; 3+ messages in thread
From: Tianxianting @ 2020-12-10 4:08 UTC (permalink / raw)
To: Ming Lei; +Cc: axboe, linux-block, linux-kernel
Thanks for the comments,
So blk_mq_tag_idle() can be also simplified as below, I will send v2 patch for reviewing.
static inline void blk_mq_tag_idle(struct blk_mq_hw_ctx *hctx)
{
- if (!(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED))
- return;
-
- __blk_mq_tag_idle(hctx);
+ if (hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED)
+ __blk_mq_tag_idle(hctx);
}
-----Original Message-----
From: Ming Lei [mailto:ming.lei@redhat.com]
Sent: Thursday, December 10, 2020 12:01 PM
To: tianxianting (RD) <tian.xianting@h3c.com>
Cc: axboe@kernel.dk; linux-block@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH] blk-mq-tag: make blk_mq_tag_busy() return void
On Tue, Dec 08, 2020 at 03:40:02PM +0800, Xianting Tian wrote:
> As no one cares about the return value of blk_mq_tag_busy() and
> __blk_mq_tag_busy(), so make them return void.
>
> Signed-off-by: Xianting Tian <tian.xianting@h3c.com>
> ---
> block/blk-mq-tag.c | 4 ++--
> block/blk-mq-tag.h | 8 ++++----
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index
> 9c92053e7..21ff7d156 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -21,7 +21,7 @@
> * to get tag when first time, the other shared-tag users could reserve
> * budget for it.
> */
> -bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> +void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> {
> if (blk_mq_is_sbitmap_shared(hctx->flags)) {
> struct request_queue *q = hctx->queue; @@ -36,7 +36,7 @@ bool
> __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> atomic_inc(&hctx->tags->active_queues);
> }
>
> - return true;
> + return;
> }
>
> /*
> diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h index
> 7d3e6b333..dd80e5a85 100644
> --- a/block/blk-mq-tag.h
> +++ b/block/blk-mq-tag.h
> @@ -60,15 +60,15 @@ enum {
> BLK_MQ_TAG_MAX = BLK_MQ_NO_TAG - 1,
> };
>
> -extern bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *);
> +extern void __blk_mq_tag_busy(struct blk_mq_hw_ctx *);
> extern void __blk_mq_tag_idle(struct blk_mq_hw_ctx *);
>
> -static inline bool blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> +static inline void blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
> {
> if (!(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED))
> - return false;
> + return;
>
> - return __blk_mq_tag_busy(hctx);
> + __blk_mq_tag_busy(hctx);
The above can be simplified as:
if (hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED)
__blk_mq_tag_busy(hctx);
Otherwise, looks fine:
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Thanks,
Ming
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-10 4:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 7:40 [PATCH] blk-mq-tag: make blk_mq_tag_busy() return void Xianting Tian
2020-12-10 4:00 ` Ming Lei
2020-12-10 4:08 ` Tianxianting
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.