aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/block/genhd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-07-27 08:25:18 +0200
committerJens Axboe <axboe@kernel.dk>2021-08-02 13:37:28 -0600
commitabd2864a3e46368a58f3718491521779099bfc14 (patch)
treee3ed2abdbc812ff2aabd8841b0cd23f8b9bc5039 /block/genhd.c
parentblock: simplify disk name formatting in check_partition (diff)
downloadwireguard-linux-abd2864a3e46368a58f3718491521779099bfc14.tar.xz
wireguard-linux-abd2864a3e46368a58f3718491521779099bfc14.zip
block: remove disk_name()
Remove the disk_name function now that all users are gone. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20210727062518.122108-7-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 6ed58fda2c05..38f053074159 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -78,11 +78,17 @@ 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 disk into the supplied buffer and
- * return a pointer to that same buffer for convenience.
+ * 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.
*/
-char *disk_name(struct gendisk *hd, int partno, char *buf)
+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]))
@@ -92,11 +98,6 @@ char *disk_name(struct gendisk *hd, int partno, char *buf)
return buf;
}
-
-const char *bdevname(struct block_device *bdev, char *buf)
-{
- return disk_name(bdev->bd_disk, bdev->bd_partno, buf);
-}
EXPORT_SYMBOL(bdevname);
static void part_stat_read_all(struct block_device *part,