mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 01:56:40 +07:00
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 <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
8a63a86e1f
commit
700cd59db5
@ -940,13 +940,13 @@ char *bdev_name(char *buf, char *end, struct block_device *bdev,
|
|||||||
|
|
||||||
hd = bdev->bd_disk;
|
hd = bdev->bd_disk;
|
||||||
buf = string(buf, end, hd->disk_name, spec);
|
buf = string(buf, end, hd->disk_name, spec);
|
||||||
if (bdev->bd_part->partno) {
|
if (bdev->bd_partno) {
|
||||||
if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) {
|
if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) {
|
||||||
if (buf < end)
|
if (buf < end)
|
||||||
*buf = 'p';
|
*buf = 'p';
|
||||||
buf++;
|
buf++;
|
||||||
}
|
}
|
||||||
buf = number(buf, end, bdev->bd_part->partno, spec);
|
buf = number(buf, end, bdev->bd_partno, spec);
|
||||||
}
|
}
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user