summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-09-03 07:41:03 +0200
committerJens Axboe <axboe@kernel.dk>2020-09-25 08:18:58 -0600
commit8a63a86e1f933dc7f114497408c50c58a633b8bc (patch)
tree44fd60fd7fe7254186542bd2b8441c23fee5aeff /block
parent57ba10592030be8c8b17184ca093db5e45cdbb2b (diff)
downloadlinux-8a63a86e1f933dc7f114497408c50c58a633b8bc.tar.bz2
block: use bd_partno in bdevname
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>
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 05fb27cbb667..e5f17f022ec7 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -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);