Skip to content

Commit 700cd59

Browse files
Christoph Hellwigaxboe
authored andcommitted
vsprintf: use bd_partno in bdev_name
No need to go through the hd_struct to find the partition number. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 8a63a86 commit 700cd59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/vsprintf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,13 +940,13 @@ char *bdev_name(char *buf, char *end, struct block_device *bdev,
940940

941941
hd = bdev->bd_disk;
942942
buf = string(buf, end, hd->disk_name, spec);
943-
if (bdev->bd_part->partno) {
943+
if (bdev->bd_partno) {
944944
if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) {
945945
if (buf < end)
946946
*buf = 'p';
947947
buf++;
948948
}
949-
buf = number(buf, end, bdev->bd_part->partno, spec);
949+
buf = number(buf, end, bdev->bd_partno, spec);
950950
}
951951
return buf;
952952
}

0 commit comments

Comments
 (0)