block: use bd_partno in bdevname
authorChristoph Hellwig <hch@lst.de>
Thu, 3 Sep 2020 05:41:03 +0000 (07:41 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 25 Sep 2020 14:18:58 +0000 (08:18 -0600)
No need to go through the hd_struct to find the partition number.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c

index 05fb27c..e5f17f0 100644 (file)
@@ -85,7 +85,7 @@ char *disk_name(struct gendisk *hd, int partno, char *buf)
 
 const char *bdevname(struct block_device *bdev, char *buf)
 {
-       return disk_name(bdev->bd_disk, bdev->bd_part->partno, buf);
+       return disk_name(bdev->bd_disk, bdev->bd_partno, buf);
 }
 EXPORT_SYMBOL(bdevname);