All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Song Liu <song@kernel.org>, "Theodore Ts'o" <tytso@mit.edu>,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	linux-raid@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: [PATCH 08/10] raid5-ppl: stop using bio_devname
Date: Fri,  4 Mar 2022 19:01:03 +0100	[thread overview]
Message-ID: <20220304180105.409765-9-hch@lst.de> (raw)
In-Reply-To: <20220304180105.409765-1-hch@lst.de>

Use the %pg format specifier to save on stack consuption and code size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/raid5-ppl.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
index 93d9364a930e3..845db0ba7c17f 100644
--- a/drivers/md/raid5-ppl.c
+++ b/drivers/md/raid5-ppl.c
@@ -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);
 }
@@ -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;
@@ -634,7 +631,6 @@ 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,
@@ -642,8 +638,7 @@ static void ppl_do_flush(struct ppl_io_unit *io)
 			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++;
-- 
2.30.2


WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-raid@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
	linux-block@vger.kernel.org, Song Liu <song@kernel.org>,
	dm-devel@redhat.com, linux-ext4@vger.kernel.org
Subject: [dm-devel] [PATCH 08/10] raid5-ppl: stop using bio_devname
Date: Fri,  4 Mar 2022 19:01:03 +0100	[thread overview]
Message-ID: <20220304180105.409765-9-hch@lst.de> (raw)
In-Reply-To: <20220304180105.409765-1-hch@lst.de>

Use the %pg format specifier to save on stack consuption and code size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/raid5-ppl.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
index 93d9364a930e3..845db0ba7c17f 100644
--- a/drivers/md/raid5-ppl.c
+++ b/drivers/md/raid5-ppl.c
@@ -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);
 }
@@ -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;
@@ -634,7 +631,6 @@ 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,
@@ -642,8 +638,7 @@ static void ppl_do_flush(struct ppl_io_unit *io)
 			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++;
-- 
2.30.2

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  parent reply	other threads:[~2022-03-04 18:01 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 18:00 remove bio_devname Christoph Hellwig
2022-03-04 18:00 ` [dm-devel] " Christoph Hellwig
2022-03-04 18:00 ` [PATCH 01/10] block: fix and cleanup bio_check_ro Christoph Hellwig
2022-03-04 18:00   ` [dm-devel] " Christoph Hellwig
2022-03-07  3:05   ` Chaitanya Kulkarni
2022-03-07  3:05     ` [dm-devel] " Chaitanya Kulkarni
2022-03-04 18:00 ` [PATCH 02/10] block: remove handle_bad_sector Christoph Hellwig
2022-03-04 18:00   ` [dm-devel] " Christoph Hellwig
2022-03-07  3:05   ` Chaitanya Kulkarni
2022-03-07  3:05     ` [dm-devel] " Chaitanya Kulkarni
2022-03-04 18:00 ` [PATCH 03/10] pktcdvd: remove a pointless debug check in pkt_submit_bio Christoph Hellwig
2022-03-04 18:00   ` [dm-devel] " Christoph Hellwig
2022-03-04 18:00 ` [PATCH 04/10] dm-crypt: stop using bio_devname Christoph Hellwig
2022-03-04 18:00   ` [dm-devel] " Christoph Hellwig
2022-03-07  3:07   ` Chaitanya Kulkarni
2022-03-07  3:07     ` [dm-devel] " Chaitanya Kulkarni
2022-03-04 18:01 ` [PATCH 05/10] dm-integrity: " Christoph Hellwig
2022-03-04 18:01   ` [dm-devel] " Christoph Hellwig
2022-03-07  3:07   ` Chaitanya Kulkarni
2022-03-07  3:07     ` [dm-devel] " Chaitanya Kulkarni
2022-03-04 18:01 ` [PATCH 06/10] md-multipath: " Christoph Hellwig
2022-03-04 18:01   ` [dm-devel] " Christoph Hellwig
2022-03-04 19:14   ` Song Liu
2022-03-07  3:07   ` Chaitanya Kulkarni
2022-03-07  3:07     ` [dm-devel] " Chaitanya Kulkarni
2022-03-04 18:01 ` [PATCH 07/10] raid1: " Christoph Hellwig
2022-03-04 18:01   ` [dm-devel] " Christoph Hellwig
2022-03-04 19:14   ` Song Liu
2022-03-07  3:06   ` Chaitanya Kulkarni
2022-03-07  3:06     ` [dm-devel] " Chaitanya Kulkarni
2022-03-04 18:01 ` Christoph Hellwig [this message]
2022-03-04 18:01   ` [dm-devel] [PATCH 08/10] raid5-ppl: " Christoph Hellwig
2022-03-04 19:14   ` Song Liu
2022-03-04 18:01 ` [PATCH 09/10] ext4: " Christoph Hellwig
2022-03-04 18:01   ` [dm-devel] " Christoph Hellwig
2022-03-07  3:08   ` Chaitanya Kulkarni
2022-03-07  3:08     ` [dm-devel] " Chaitanya Kulkarni
2022-03-04 18:01 ` [PATCH 10/10] block: remove bio_devname Christoph Hellwig
2022-03-04 18:01   ` [dm-devel] " Christoph Hellwig
2022-03-07  3:06   ` Chaitanya Kulkarni
2022-03-07  3:06     ` [dm-devel] " Chaitanya Kulkarni
2022-03-07 11:38 ` Johannes Thumshirn
2022-03-07 11:38   ` [dm-devel] " Johannes Thumshirn
2022-03-07 13:42 ` Jens Axboe
2022-03-07 13:42   ` [dm-devel] " Jens Axboe
2022-03-07 16:45   ` Mike Snitzer
2022-03-07 16:45     ` [dm-devel] " Mike Snitzer
2022-03-07 16:48     ` Christoph Hellwig
2022-03-07 16:48       ` [dm-devel] " Christoph Hellwig
2022-03-07 16:56       ` Mike Snitzer
2022-03-07 16:56         ` [dm-devel] " Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220304180105.409765-9-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.