linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: heinzm@redhat.com
To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org
Cc: ncroxon@redhat.com, xni@redhat.com
Subject: [PATCH 2/3] md raid1: make first_clone a bool
Date: Thu, 10 Aug 2023 14:11:31 +0200	[thread overview]
Message-ID: <d6913d99e76bb72d3561fc9665e089fa5c7a1fb3.1691592775.git.heinzm@redhat.com> (raw)
In-Reply-To: <cover.1691592775.git.heinzm@redhat.com>

From: heinzm <heinzm@redhat.com>

first_clone is used as a bool so make it one.

Signed-off-by: heinzm <heinzm@redhat.com>
---
 drivers/md/raid1.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 913cd46b786b..0aed74efd758 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1337,9 +1337,8 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
 	struct bitmap *bitmap = mddev->bitmap;
 	unsigned long flags;
 	struct md_rdev *blocked_rdev;
-	int first_clone;
 	int max_sectors;
-	bool write_behind = false;
+	bool first_clone, write_behind = false;
 
 	if (mddev_is_clustered(mddev) &&
 	     md_cluster_ops->area_resyncing(mddev, WRITE,
@@ -1505,7 +1504,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
 	atomic_set(&r1_bio->remaining, 1);
 	atomic_set(&r1_bio->behind_remaining, 0);
 
-	first_clone = 1;
+	first_clone = true;
 
 	for (i = 0; i < disks; i++) {
 		struct bio *mbio = NULL;
@@ -1528,7 +1527,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
 
 			md_bitmap_startwrite(bitmap, r1_bio->sector, r1_bio->sectors,
 					     test_bit(R1BIO_BehindIO, &r1_bio->state));
-			first_clone = 0;
+			first_clone = false;
 		}
 
 		if (r1_bio->behind_master_bio) {
-- 
2.41.0


  parent reply	other threads:[~2023-08-10 12:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 12:11 [PATCH 0/3] md raid1: Fix writebehind/writemostly heinzm
2023-08-10 12:11 ` [PATCH 1/3] md raid1: allow writebehind to work on any leg device set WriteMostly heinzm
2023-08-11  1:14   ` Yu Kuai
2023-08-10 12:11 ` heinzm [this message]
2023-08-10 12:11 ` [PATCH 3/3] md raid1: add empty line heinzm
2023-08-13 17:56 ` [PATCH 0/3] md raid1: Fix writebehind/writemostly Song Liu

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=d6913d99e76bb72d3561fc9665e089fa5c7a1fb3.1691592775.git.heinzm@redhat.com \
    --to=heinzm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=xni@redhat.com \
    /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).