diff --git a/drivers/md/md.c b/drivers/md/md.c index 03437140b05b0d91a2d405d5447635f7db8a54a1..a299fda5b0e962407c4d3604b4d381cd5822fb5b 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8430,14 +8430,15 @@ static int is_mddev_idle(struct mddev *mddev, int init) { struct md_rdev *rdev; int idle; - int curr_events; + long long curr_events; idle = 1; rcu_read_lock(); rdev_for_each_rcu(rdev, mddev) { struct gendisk *disk = rdev->bdev->bd_disk; - curr_events = (int)part_stat_read_accum(&disk->part0, sectors) - - atomic_read(&disk->sync_io); + curr_events = + (long long)part_stat_read_accum(&disk->part0, sectors) - + atomic64_read(&disk->sync_io_sectors); /* sync IO will cause sync_io to increase before the disk_stats * as sync_io is counted when a request starts, and * disk_stats is counted when it completes. diff --git a/drivers/md/md.h b/drivers/md/md.h index 766ecfb0ff5c9b61452da50a6b459b9e13a6ec01..85177d068322928beeb0f91cdedc31b99d6443c2 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -50,7 +50,7 @@ struct md_rdev { sector_t sectors; /* Device size (in 512bytes sectors) */ struct mddev *mddev; /* RAID array if running */ - int last_events; /* IO event timestamp */ + long long last_events; /* IO event timestamp */ /* * If meta_bdev is non-NULL, it means that a separate device is @@ -554,12 +554,12 @@ extern void mddev_unlock(struct mddev *mddev); static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors) { - atomic_add(nr_sectors, &bdev->bd_disk->sync_io); + atomic64_add(nr_sectors, &bdev->bd_disk->sync_io_sectors); } static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors) { - atomic_add(nr_sectors, &bio->bi_disk->sync_io); + atomic64_add(nr_sectors, &bio->bi_disk->sync_io_sectors); } struct md_personality diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 47ee862a7c5664978aa2eb76111fa59e222ce253..09da27361620cd34e4407d118456825a3f16fb50 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -208,7 +208,7 @@ struct gendisk { struct kobject *slave_dir; struct timer_rand_state *random; - atomic_t sync_io; /* RAID */ + atomic64_t sync_io_sectors; /* RAID */ struct disk_events *ev; #ifdef CONFIG_BLK_DEV_INTEGRITY struct kobject integrity_kobj;