Skip to content

Commit

Permalink
raid5-ppl: stop using bio_devname
Browse files Browse the repository at this point in the history
Use the %pg format specifier to save on stack consuption and code size.

Signed-off-by: Christoph Hellwig <[email protected]>
Acked-by: Song Liu <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Mar 7, 2022
1 parent ac483eb commit c7dec46
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions drivers/md/raid5-ppl.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,10 @@ static void ppl_log_endio(struct bio *bio)

static void ppl_submit_iounit_bio(struct ppl_io_unit *io, struct bio *bio)
{
char b[BDEVNAME_SIZE];

pr_debug("%s: seq: %llu size: %u sector: %llu dev: %s\n",
pr_debug("%s: seq: %llu size: %u sector: %llu dev: %pg\n",
__func__, io->seq, bio->bi_iter.bi_size,
(unsigned long long)bio->bi_iter.bi_sector,
bio_devname(bio, b));
bio->bi_bdev);

submit_bio(bio);
}
Expand Down Expand Up @@ -589,9 +587,8 @@ static void ppl_flush_endio(struct bio *bio)
struct ppl_log *log = io->log;
struct ppl_conf *ppl_conf = log->ppl_conf;
struct r5conf *conf = ppl_conf->mddev->private;
char b[BDEVNAME_SIZE];

pr_debug("%s: dev: %s\n", __func__, bio_devname(bio, b));
pr_debug("%s: dev: %pg\n", __func__, bio->bi_bdev);

if (bio->bi_status) {
struct md_rdev *rdev;
Expand Down Expand Up @@ -634,16 +631,14 @@ static void ppl_do_flush(struct ppl_io_unit *io)

if (bdev) {
struct bio *bio;
char b[BDEVNAME_SIZE];

bio = bio_alloc_bioset(bdev, 0, GFP_NOIO,
REQ_OP_WRITE | REQ_PREFLUSH,
&ppl_conf->flush_bs);
bio->bi_private = io;
bio->bi_end_io = ppl_flush_endio;

pr_debug("%s: dev: %s\n", __func__,
bio_devname(bio, b));
pr_debug("%s: dev: %ps\n", __func__, bio->bi_bdev);

submit_bio(bio);
flushed_disks++;
Expand Down

0 comments on commit c7dec46

Please sign in to comment.