Linux-Raid Archives mirror
 help / color / mirror / Atom feed
From: tada keisuke <keisuke1.tada@kioxia.com>
To: "song@kernel.org" <song@kernel.org>,
	"yukuai3@huawei.com" <yukuai3@huawei.com>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH 05/11] md: match the type of variables to percpu_ref
Date: Tue, 26 Mar 2024 10:29:34 +0000	[thread overview]
Message-ID: <d61c1d984cf345f084857e5461dc087d@kioxia.com> (raw)

This patch depends on patch 04.

The counter size of percpu_ref is different from that of atomic_t.
This is the only place where the value of nr_pending is read.
The others are used for zero check and type has no effect.

Signed-off-by: Keisuke TADA <keisuke1.tada@kioxia.com>
Signed-off-by: Toshifumi OHTAKE <toshifumi.ootake@kioxia.com>
---
 drivers/md/md.h     | 4 ++--
 drivers/md/raid1.c  | 4 ++--
 drivers/md/raid10.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/md/md.h b/drivers/md/md.h
index ed7e36212d58..724439400ed1 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -231,9 +231,9 @@ static inline bool nr_pending_is_not_zero(struct md_rdev *rdev)
 	return atomic_read(&rdev->nr_pending) != 0;
 }
 
-static inline unsigned int nr_pending_read(struct md_rdev *rdev)
+static inline unsigned long nr_pending_read(struct md_rdev *rdev)
 {
-	return atomic_read(&rdev->nr_pending);
+	return (unsigned long)atomic_read(&rdev->nr_pending);
 }
 
 static inline int is_badblock(struct md_rdev *rdev, sector_t s, int sectors,
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 9cf56bc1340f..43cc36fec7a2 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -751,7 +751,7 @@ static bool rdev_readable(struct md_rdev *rdev, struct r1bio *r1_bio)
 struct read_balance_ctl {
 	sector_t closest_dist;
 	int closest_dist_disk;
-	int min_pending;
+	long min_pending;
 	int min_pending_disk;
 	int sequential_disk;
 	int readable_disks;
@@ -771,7 +771,7 @@ static int choose_best_rdev(struct r1conf *conf, struct r1bio *r1_bio)
 	for (disk = 0 ; disk < conf->raid_disks * 2 ; disk++) {
 		struct md_rdev *rdev;
 		sector_t dist;
-		unsigned int pending;
+		unsigned long pending;
 
 		if (r1_bio->bios[disk] == IO_BLOCKED)
 			continue;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index d8c4bf608767..cd5094c4df50 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -733,7 +733,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
 	int do_balance;
 	int best_dist_slot, best_pending_slot;
 	bool has_nonrot_disk = false;
-	unsigned int min_pending;
+	unsigned long min_pending;
 	struct geom *geo = &conf->geo;
 
 	raid10_find_phys(conf, r10_bio);
@@ -753,7 +753,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
 		sector_t first_bad;
 		int bad_sectors;
 		sector_t dev_sector;
-		unsigned int pending;
+		unsigned long pending;
 		bool nonrot;
 
 		if (r10_bio->devs[slot].bio == IO_BLOCKED)
-- 
2.34.1


                 reply	other threads:[~2024-03-26 11:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=d61c1d984cf345f084857e5461dc087d@kioxia.com \
    --to=keisuke1.tada@kioxia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=yukuai3@huawei.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 read-only IMAP folder(s) and NNTP newsgroup(s).