summaryrefslogtreecommitdiff
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-03-01 11:38:15 +0300
committerMike Snitzer <snitzer@redhat.com>2022-03-02 20:15:54 +0300
commit385411ffba0c3305491346b98ba4d2cd8063f002 (patch)
tree7a1d403b97060ac2e05a36981b8881cab6b2e42d /drivers/md/dm-table.c
parent977ff73e64151d94811f4ba905419c90573f63e1 (diff)
downloadlinux-385411ffba0c3305491346b98ba4d2cd8063f002.tar.xz
dm: stop using bdevname
Just use the %pg format specifier instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r--drivers/md/dm-table.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index e43096cfe9e2..f4ed756ab391 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -230,15 +230,14 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
sector_t dev_size = bdev_nr_sectors(bdev);
unsigned short logical_block_size_sectors =
limits->logical_block_size >> SECTOR_SHIFT;
- char b[BDEVNAME_SIZE];
if (!dev_size)
return 0;
if ((start >= dev_size) || (start + len > dev_size)) {
- DMWARN("%s: %s too small for target: "
+ DMWARN("%s: %pg too small for target: "
"start=%llu, len=%llu, dev_size=%llu",
- dm_device_name(ti->table->md), bdevname(bdev, b),
+ dm_device_name(ti->table->md), bdev,
(unsigned long long)start,
(unsigned long long)len,
(unsigned long long)dev_size);
@@ -253,10 +252,10 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
unsigned int zone_sectors = bdev_zone_sectors(bdev);
if (start & (zone_sectors - 1)) {
- DMWARN("%s: start=%llu not aligned to h/w zone size %u of %s",
+ DMWARN("%s: start=%llu not aligned to h/w zone size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)start,
- zone_sectors, bdevname(bdev, b));
+ zone_sectors, bdev);
return 1;
}
@@ -270,10 +269,10 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
* the sector range.
*/
if (len & (zone_sectors - 1)) {
- DMWARN("%s: len=%llu not aligned to h/w zone size %u of %s",
+ DMWARN("%s: len=%llu not aligned to h/w zone size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)len,
- zone_sectors, bdevname(bdev, b));
+ zone_sectors, bdev);
return 1;
}
}
@@ -283,19 +282,19 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
if (start & (logical_block_size_sectors - 1)) {
DMWARN("%s: start=%llu not aligned to h/w "
- "logical block size %u of %s",
+ "logical block size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)start,
- limits->logical_block_size, bdevname(bdev, b));
+ limits->logical_block_size, bdev);
return 1;
}
if (len & (logical_block_size_sectors - 1)) {
DMWARN("%s: len=%llu not aligned to h/w "
- "logical block size %u of %s",
+ "logical block size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)len,
- limits->logical_block_size, bdevname(bdev, b));
+ limits->logical_block_size, bdev);
return 1;
}
@@ -400,20 +399,19 @@ static int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
struct queue_limits *limits = data;
struct block_device *bdev = dev->bdev;
struct request_queue *q = bdev_get_queue(bdev);
- char b[BDEVNAME_SIZE];
if (unlikely(!q)) {
- DMWARN("%s: Cannot set limits for nonexistent device %s",
- dm_device_name(ti->table->md), bdevname(bdev, b));
+ DMWARN("%s: Cannot set limits for nonexistent device %pg",
+ dm_device_name(ti->table->md), bdev);
return 0;
}
if (blk_stack_limits(limits, &q->limits,
get_start_sect(bdev) + start) < 0)
- DMWARN("%s: adding target device %s caused an alignment inconsistency: "
+ DMWARN("%s: adding target device %pg caused an alignment inconsistency: "
"physical_block_size=%u, logical_block_size=%u, "
"alignment_offset=%u, start=%llu",
- dm_device_name(ti->table->md), bdevname(bdev, b),
+ dm_device_name(ti->table->md), bdev,
q->limits.physical_block_size,
q->limits.logical_block_size,
q->limits.alignment_offset,