diff options
author | Christoph Hellwig <hch@lst.de> | 2022-05-12 08:19:13 +0200 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2022-05-22 23:07:21 -0700 |
commit | 913cce5a1e588e3470ea064fe4ea336037d3a454 (patch) | |
tree | d5335aef357429a908652048eb5c83292640a612 /drivers/md/raid5-ppl.c | |
parent | 1e267742283a4b5a8ca65755c44166be27e9aa0f (diff) | |
download | lwn-913cce5a1e588e3470ea064fe4ea336037d3a454.tar.gz lwn-913cce5a1e588e3470ea064fe4ea336037d3a454.zip |
md: remove most calls to bdevname
Use the %pg format specifier to save on stack consumption and code size.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/raid5-ppl.c')
-rw-r--r-- | drivers/md/raid5-ppl.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index 55d065a87b89..973e2e06f19c 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -798,7 +798,6 @@ static int ppl_recover_entry(struct ppl_log *log, struct ppl_header_entry *e, int data_disks; int i; int ret = 0; - char b[BDEVNAME_SIZE]; unsigned int pp_size = le32_to_cpu(e->pp_size); unsigned int data_size = le32_to_cpu(e->data_size); @@ -894,8 +893,8 @@ static int ppl_recover_entry(struct ppl_log *log, struct ppl_header_entry *e, break; } - pr_debug("%s:%*s reading data member disk %s sector %llu\n", - __func__, indent, "", bdevname(rdev->bdev, b), + pr_debug("%s:%*s reading data member disk %pg sector %llu\n", + __func__, indent, "", rdev->bdev, (unsigned long long)sector); if (!sync_page_io(rdev, sector, block_size, page2, REQ_OP_READ, 0, false)) { @@ -942,10 +941,10 @@ static int ppl_recover_entry(struct ppl_log *log, struct ppl_header_entry *e, conf->disks[sh.pd_idx].rdev, 1); BUG_ON(parity_rdev->bdev->bd_dev != log->rdev->bdev->bd_dev); - pr_debug("%s:%*s write parity at sector %llu, disk %s\n", + pr_debug("%s:%*s write parity at sector %llu, disk %pg\n", __func__, indent, "", (unsigned long long)parity_sector, - bdevname(parity_rdev->bdev, b)); + parity_rdev->bdev); if (!sync_page_io(parity_rdev, parity_sector, block_size, page1, REQ_OP_WRITE, 0, false)) { pr_debug("%s:%*s parity write error!\n", __func__, @@ -1255,7 +1254,6 @@ void ppl_exit_log(struct r5conf *conf) static int ppl_validate_rdev(struct md_rdev *rdev) { - char b[BDEVNAME_SIZE]; int ppl_data_sectors; int ppl_size_new; @@ -1272,8 +1270,8 @@ static int ppl_validate_rdev(struct md_rdev *rdev) RAID5_STRIPE_SECTORS((struct r5conf *)rdev->mddev->private)); if (ppl_data_sectors <= 0) { - pr_warn("md/raid:%s: PPL space too small on %s\n", - mdname(rdev->mddev), bdevname(rdev->bdev, b)); + pr_warn("md/raid:%s: PPL space too small on %pg\n", + mdname(rdev->mddev), rdev->bdev); return -ENOSPC; } @@ -1283,16 +1281,16 @@ static int ppl_validate_rdev(struct md_rdev *rdev) rdev->ppl.sector + ppl_size_new > rdev->data_offset) || (rdev->ppl.sector >= rdev->data_offset && rdev->data_offset + rdev->sectors > rdev->ppl.sector)) { - pr_warn("md/raid:%s: PPL space overlaps with data on %s\n", - mdname(rdev->mddev), bdevname(rdev->bdev, b)); + pr_warn("md/raid:%s: PPL space overlaps with data on %pg\n", + mdname(rdev->mddev), rdev->bdev); return -EINVAL; } if (!rdev->mddev->external && ((rdev->ppl.offset > 0 && rdev->ppl.offset < (rdev->sb_size >> 9)) || (rdev->ppl.offset <= 0 && rdev->ppl.offset + ppl_size_new > 0))) { - pr_warn("md/raid:%s: PPL space overlaps with superblock on %s\n", - mdname(rdev->mddev), bdevname(rdev->bdev, b)); + pr_warn("md/raid:%s: PPL space overlaps with superblock on %pg\n", + mdname(rdev->mddev), rdev->bdev); return -EINVAL; } @@ -1463,14 +1461,13 @@ int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add) struct ppl_conf *ppl_conf = conf->log_private; struct ppl_log *log; int ret = 0; - char b[BDEVNAME_SIZE]; if (!rdev) return -EINVAL; - pr_debug("%s: disk: %d operation: %s dev: %s\n", + pr_debug("%s: disk: %d operation: %s dev: %pg\n", __func__, rdev->raid_disk, add ? "add" : "remove", - bdevname(rdev->bdev, b)); + rdev->bdev); if (rdev->raid_disk < 0) return 0; |