summaryrefslogtreecommitdiff
path: root/block/genhd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-24 09:37:14 +0100
committerJens Axboe <axboe@kernel.dk>2020-12-01 14:53:40 -0700
commit41e5c81984eac8ce87f2b4f57fec0bd90a049b2b (patch)
treee3df22a54db95b1875e8680a9c77e131cddee383 /block/genhd.c
parent8446fe9255be821cb38ffd306d7e8edc4b9ea662 (diff)
block: remove the partno field from struct hd_struct
Just use the bd_partno field in struct block_device everywhere. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/block/genhd.c b/block/genhd.c
index ed06466b305d..b7e39b41a275 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -589,8 +589,8 @@ int blk_alloc_devt(struct hd_struct *part, dev_t *devt)
int idx;
/* in consecutive minor range? */
- if (part->partno < disk->minors) {
- *devt = MKDEV(disk->major, disk->first_minor + part->partno);
+ if (part->bdev->bd_partno < disk->minors) {
+ *devt = MKDEV(disk->major, disk->first_minor + part->bdev->bd_partno);
return 0;
}
@@ -864,7 +864,7 @@ void del_gendisk(struct gendisk *disk)
disk_part_iter_init(&piter, disk,
DISK_PITER_INCL_EMPTY | DISK_PITER_REVERSE);
while ((part = disk_part_iter_next(&piter))) {
- invalidate_partition(disk, part->partno);
+ invalidate_partition(disk, part->bdev->bd_partno);
delete_partition(part);
}
disk_part_iter_exit(&piter);
@@ -1008,7 +1008,7 @@ void __init printk_all_partitions(void)
printk("%s%s %10llu %s %s", is_part0 ? "" : " ",
bdevt_str(part_devt(part), devt_buf),
bdev_nr_sectors(part->bdev) >> 1,
- disk_name(disk, part->partno, name_buf),
+ disk_name(disk, part->bdev->bd_partno, name_buf),
part->bdev->bd_meta_info ?
part->bdev->bd_meta_info->uuid : "");
if (is_part0) {
@@ -1102,7 +1102,7 @@ static int show_partition(struct seq_file *seqf, void *v)
seq_printf(seqf, "%4d %7d %10llu %s\n",
MAJOR(part_devt(part)), MINOR(part_devt(part)),
bdev_nr_sectors(part->bdev) >> 1,
- disk_name(sgp, part->partno, buf));
+ disk_name(sgp, part->bdev->bd_partno, buf));
disk_part_iter_exit(&piter);
return 0;
@@ -1525,7 +1525,7 @@ static int diskstats_show(struct seq_file *seqf, void *v)
"%lu %u"
"\n",
MAJOR(part_devt(hd)), MINOR(part_devt(hd)),
- disk_name(gp, hd->partno, buf),
+ disk_name(gp, hd->bdev->bd_partno, buf),
stat.ios[STAT_READ],
stat.merges[STAT_READ],
stat.sectors[STAT_READ],