Skip to content

Commit

Permalink
block: use bd_partno in bdevname
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Sep 25, 2020
1 parent 57ba105 commit 8a63a86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8a63a86

Please sign in to comment.