linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-block@vger.kernel.org, axboe@kernel.dk
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH] blk-mq: Use helpers to access rq->state
Date: Wed, 12 May 2021 12:50:17 +0300	[thread overview]
Message-ID: <20210512095017.235295-1-nborisov@suse.com> (raw)

Instead of having a mixed bag of opencoded usage and helper usage,
simply replace opencoded sites with the appropriate helper. No
functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 block/blk-mq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index d4d7c1caa439..d1cfacf2734c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -644,7 +644,7 @@ static void blk_mq_raise_softirq(struct request *rq)
 
 bool blk_mq_complete_request_remote(struct request *rq)
 {
-	WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
+	blk_mq_set_request_complete(rq);
 
 	/*
 	 * For a polled request, always complete locallly, it's pointless
@@ -721,7 +721,7 @@ void blk_mq_start_request(struct request *rq)
 		rq_qos_issue(q, rq);
 	}
 
-	WARN_ON_ONCE(blk_mq_rq_state(rq) != MQ_RQ_IDLE);
+	WARN_ON_ONCE(blk_mq_request_started(rq));
 
 	blk_add_timer(rq);
 	WRITE_ONCE(rq->state, MQ_RQ_IN_FLIGHT);
@@ -3812,7 +3812,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
 	hrtimer_set_expires(&hs.timer, kt);
 
 	do {
-		if (blk_mq_rq_state(rq) == MQ_RQ_COMPLETE)
+		if (blk_mq_request_completed(rq))
 			break;
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		hrtimer_sleeper_start_expires(&hs, mode);
-- 
2.25.1


             reply	other threads:[~2021-05-12  9:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12  9:50 Nikolay Borisov [this message]
2021-05-12 15:24 ` [PATCH] blk-mq: Use helpers to access rq->state Hannes Reinecke
2021-05-12 20:01 ` Chaitanya Kulkarni
2021-08-30 14:24 ` Nikolay Borisov
2021-08-30 17:29 ` Bart Van Assche
2021-08-31  6:42   ` Nikolay Borisov

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=20210512095017.235295-1-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).