mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 15:02:40 -04:00
block: remove bdevname
Replace the remaining calls of bdevname with snprintf using the %pg format specifier. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20220713055317.1888500-10-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
c5b045b983
commit
900d156bac
@@ -101,29 +101,6 @@ bool set_capacity_and_notify(struct gendisk *disk, sector_t size)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(set_capacity_and_notify);
|
||||
|
||||
/*
|
||||
* Format the device name of the indicated block device into the supplied buffer
|
||||
* and return a pointer to that same buffer for convenience.
|
||||
*
|
||||
* Note: do not use this in new code, use the %pg specifier to sprintf and
|
||||
* printk insted.
|
||||
*/
|
||||
const char *bdevname(struct block_device *bdev, char *buf)
|
||||
{
|
||||
struct gendisk *hd = bdev->bd_disk;
|
||||
int partno = bdev->bd_partno;
|
||||
|
||||
if (!partno)
|
||||
snprintf(buf, BDEVNAME_SIZE, "%s", hd->disk_name);
|
||||
else if (isdigit(hd->disk_name[strlen(hd->disk_name)-1]))
|
||||
snprintf(buf, BDEVNAME_SIZE, "%sp%d", hd->disk_name, partno);
|
||||
else
|
||||
snprintf(buf, BDEVNAME_SIZE, "%s%d", hd->disk_name, partno);
|
||||
|
||||
return buf;
|
||||
}
|
||||
EXPORT_SYMBOL(bdevname);
|
||||
|
||||
static void part_stat_read_all(struct block_device *part,
|
||||
struct disk_stats *stat)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user