diff --git a/block/genhd.c b/block/genhd.c index 16ad881172d01219d4b66d98c29cd8317252ea26..cc114dd0265bddd916b0bb51db0bfbee11bf4cc7 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1312,10 +1312,10 @@ static void part_get_stat_info(struct hd_struct *hd, struct disk_stats *stat, if (queue_is_mq(q)) { part_stat_lock(); - spin_lock(&hd->bd_stat_lock); + mutex_lock(&part_to_dev(hd)->mutex); part_set_stat_time(hd); *inflight = blk_mq_in_flight_with_stat(q, hd); - spin_unlock(&hd->bd_stat_lock); + mutex_unlock(&part_to_dev(hd)->mutex); part_stat_unlock(); } else { *inflight = part_in_flight(hd); diff --git a/block/partitions/core.c b/block/partitions/core.c index 92c723c19bb0baabf2baf48fdc3bf2e8444ca0ac..8f32f3cd0edebb94bf6a9be98a31b89303b3b218 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -416,7 +416,6 @@ static struct hd_struct *add_partition(struct gendisk *disk, int partno, p->partno = partno; p->read_only = get_disk_ro(disk) | test_bit(partno, disk->user_ro_bitmap); p->stat_time = 0; - spin_lock_init(&p->bd_stat_lock); if (info) { struct partition_meta_info *pinfo; diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 07122c79210c5a669044175620f9e65340a7f805..05927a1c6b5b18c8ae00626edfc65ccdca7cc998 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -63,8 +63,6 @@ struct hd_struct { seqcount_t nr_sects_seq; #endif unsigned long stamp; - spinlock_t bd_stat_lock; - u64 stat_time; struct disk_stats __percpu *dkstats; struct percpu_ref ref; @@ -78,7 +76,7 @@ struct hd_struct { #endif struct rcu_work rcu_work; - KABI_RESERVE(1) + KABI_USE(1, u64 stat_time) KABI_RESERVE(2) KABI_RESERVE(3) KABI_RESERVE(4)