summaryrefslogtreecommitdiffstats
path: root/block/partition-generic.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-03-24 08:25:12 +0100
committerJens Axboe <axboe@kernel.dk>2020-03-24 07:57:07 -0600
commit5cbd28e3cef14b43b2a8271d36b75fc61c13bb8a (patch)
tree3c2243343e2631c9129f3f663c450de6f92b00ca /block/partition-generic.c
parentea3edd4dc23027083fbb4a73b65114d08fe73a76 (diff)
downloadlinux-5cbd28e3cef14b43b2a8271d36b75fc61c13bb8a.tar.bz2
block: move disk_name and related helpers out of partition-generic.c
Thes functions aren't really related to partition support, so move them to a more suitable place. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/partition-generic.c')
-rw-r--r--block/partition-generic.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 98256e6beabb..6bf5aec2a0dc 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -25,38 +25,6 @@
extern void md_autodetect_dev(dev_t dev);
#endif
-/*
- * disk_name() is used by partition check code and the genhd driver.
- * It formats the devicename of the indicated disk into
- * the supplied buffer (of size at least 32), and returns
- * a pointer to that same buffer (for convenience).
- */
-
-char *disk_name(struct gendisk *hd, int partno, char *buf)
-{
- 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;
-}
-
-const char *bdevname(struct block_device *bdev, char *buf)
-{
- return disk_name(bdev->bd_disk, bdev->bd_part->partno, buf);
-}
-
-EXPORT_SYMBOL(bdevname);
-
-const char *bio_devname(struct bio *bio, char *buf)
-{
- return disk_name(bio->bi_disk, bio->bi_partno, buf);
-}
-EXPORT_SYMBOL(bio_devname);
-
static ssize_t part_partition_show(struct device *dev,
struct device_attribute *attr, char *buf)
{