All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: linux-block@vger.kernel.org, linux-raid@vger.kernel.org
Cc: axboe@kernel.dk, kent.overstreet@linux.dev,
	janpieter.sollie@edpnet.be, colyli@suse.de, bagasdotme@gmail.com,
	Song Liu <song@kernel.org>
Subject: [PATCH 2/2] md: Use op_is_flush() to check flush bio
Date: Wed, 20 Dec 2023 17:27:15 -0800	[thread overview]
Message-ID: <20231221012715.3048221-3-song@kernel.org> (raw)
In-Reply-To: <20231221012715.3048221-1-song@kernel.org>

op_is_flush() covers different ways to request flush. Use it instead of
simply checking against REQ_PREFLUSH.

Signed-off-by: Song Liu <song@kernel.org>
---
 drivers/md/raid0.c  | 2 +-
 drivers/md/raid1.c  | 2 +-
 drivers/md/raid10.c | 2 +-
 drivers/md/raid5.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index c50a7abda744..20283dc5208a 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -592,7 +592,7 @@ static bool raid0_make_request(struct mddev *mddev, struct bio *bio)
 	unsigned chunk_sects;
 	unsigned sectors;
 
-	if (unlikely(bio->bi_opf & REQ_PREFLUSH)
+	if (unlikely(op_is_flush(bio->bi_opf))
 	    && md_flush_request(mddev, bio))
 		return true;
 
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index aaa434f0c175..5c1dadd7fbb6 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1581,7 +1581,7 @@ static bool raid1_make_request(struct mddev *mddev, struct bio *bio)
 {
 	sector_t sectors;
 
-	if (unlikely(bio->bi_opf & REQ_PREFLUSH)
+	if (unlikely(op_is_flush(bio->bi_opf))
 	    && md_flush_request(mddev, bio))
 		return true;
 
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 7412066ea22c..5c6e0a8635f2 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1857,7 +1857,7 @@ static bool raid10_make_request(struct mddev *mddev, struct bio *bio)
 	int chunk_sects = chunk_mask + 1;
 	int sectors = bio_sectors(bio);
 
-	if (unlikely(bio->bi_opf & REQ_PREFLUSH)
+	if (unlikely(op_is_flush(bio->bi_opf))
 	    && md_flush_request(mddev, bio))
 		return true;
 
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index e57deb1c6138..1bcf96b490a7 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -6070,7 +6070,7 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
 	enum stripe_result res;
 	int s, stripe_cnt;
 
-	if (unlikely(bi->bi_opf & REQ_PREFLUSH)) {
+	if (unlikely(op_is_flush(bi->bi_opf))) {
 		int ret = log_handle_flush_request(conf, bi);
 
 		if (ret == 0)
-- 
2.34.1


  parent reply	other threads:[~2023-12-21  1:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  1:27 [PATCH 0/2] block, md: Better handle REQ_OP_FLUSH Song Liu
2023-12-21  1:27 ` [PATCH 1/2] block: Check REQ_OP_FLUSH in op_is_flush() Song Liu
2023-12-21  6:12   ` Christoph Hellwig
2023-12-21  7:53     ` Song Liu
2023-12-21  1:27 ` Song Liu [this message]
2023-12-21  3:36 ` [PATCH 0/2] block, md: Better handle REQ_OP_FLUSH Ed Tsai (蔡宗軒)
2023-12-21  5:30   ` Kent Overstreet
2023-12-21  7:56     ` Ed Tsai (蔡宗軒)
2023-12-21 19:19       ` Kent Overstreet

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=20231221012715.3048221-3-song@kernel.org \
    --to=song@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bagasdotme@gmail.com \
    --cc=colyli@suse.de \
    --cc=janpieter.sollie@edpnet.be \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-raid@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.