linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 05/11] md: match the type of variables to percpu_ref
@ 2024-04-18  5:44 tada keisuke
  0 siblings, 0 replies; only message in thread
From: tada keisuke @ 2024-04-18  5:44 UTC (permalink / raw)
  To: song, yukuai3; +Cc: linux-raid, linux-kernel

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 2eaf8606af9e..783fec1f1445 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 962cebbba6cd..12318fb15a88 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 2b1238befd8a..b91dd6c0be5a 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-18  6:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18  5:44 [PATCH v2 05/11] md: match the type of variables to percpu_ref tada keisuke

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).