All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: <axboe@kernel.dk>
Cc: <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linmiaohe@huawei.com>
Subject: [PATCH] block: Use helper function blk_mq_sched_needs_restart()
Date: Sat, 5 Sep 2020 05:42:33 -0400	[thread overview]
Message-ID: <20200905094233.3888-1-linmiaohe@huawei.com> (raw)

Use helper function blk_mq_sched_needs_restart() to check if hardware queue
needs restart.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 block/blk-mq-sched.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index d2790e5b06d1..dc837fd26e17 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -65,7 +65,7 @@ void blk_mq_sched_assign_ioc(struct request *rq)
  */
 void blk_mq_sched_mark_restart_hctx(struct blk_mq_hw_ctx *hctx)
 {
-	if (test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state))
+	if (blk_mq_sched_needs_restart(hctx))
 		return;
 
 	set_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state);
@@ -74,7 +74,7 @@ EXPORT_SYMBOL_GPL(blk_mq_sched_mark_restart_hctx);
 
 void blk_mq_sched_restart(struct blk_mq_hw_ctx *hctx)
 {
-	if (!test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state))
+	if (!blk_mq_sched_needs_restart(hctx))
 		return;
 	clear_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state);
 
-- 
2.19.1


             reply	other threads:[~2020-09-05  9:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05  9:42 Miaohe Lin [this message]
2020-09-24 13:13 [PATCH] block: Use helper function blk_mq_sched_needs_restart() linmiaohe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200905094233.3888-1-linmiaohe@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.