dm-zoned: remove the ->name field in struct dmz_dev

Just use the %pg format specifier to print the block device name
directly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
Christoph Hellwig 2022-03-01 10:38:14 +02:00 committed by Mike Snitzer
parent f5b4aee10c
commit 977ff73e64
3 changed files with 6 additions and 8 deletions

View File

@ -1101,8 +1101,8 @@ static int dmz_check_sb(struct dmz_metadata *zmd, struct dmz_sb *dsb,
*/
static int dmz_read_sb(struct dmz_metadata *zmd, struct dmz_sb *sb, int set)
{
dmz_zmd_debug(zmd, "read superblock set %d dev %s block %llu",
set, sb->dev->name, sb->block);
dmz_zmd_debug(zmd, "read superblock set %d dev %pg block %llu",
set, sb->dev->bdev, sb->block);
return dmz_rdwr_block(sb->dev, REQ_OP_READ,
sb->block, sb->mblk->page);

View File

@ -730,7 +730,6 @@ static int dmz_get_zoned_device(struct dm_target *ti, char *path,
}
dev->bdev = bdev;
dev->dev_idx = idx;
(void)bdevname(dev->bdev, dev->name);
dev->capacity = bdev_nr_sectors(bdev);
if (ti->begin) {

View File

@ -56,7 +56,6 @@ struct dmz_dev {
struct dmz_metadata *metadata;
struct dmz_reclaim *reclaim;
char name[BDEVNAME_SIZE];
uuid_t uuid;
sector_t capacity;
@ -176,16 +175,16 @@ enum {
* Message functions.
*/
#define dmz_dev_info(dev, format, args...) \
DMINFO("(%s): " format, (dev)->name, ## args)
DMINFO("(%pg): " format, (dev)->bdev, ## args)
#define dmz_dev_err(dev, format, args...) \
DMERR("(%s): " format, (dev)->name, ## args)
DMERR("(%pg): " format, (dev)->bdev, ## args)
#define dmz_dev_warn(dev, format, args...) \
DMWARN("(%s): " format, (dev)->name, ## args)
DMWARN("(%pg): " format, (dev)->bdev, ## args)
#define dmz_dev_debug(dev, format, args...) \
DMDEBUG("(%s): " format, (dev)->name, ## args)
DMDEBUG("(%pg): " format, (dev)->bdev, ## args)
/*
* Functions defined in dm-zoned-metadata.c