diff mbox series

[07/10] raid1: stop using bio_devname

Message ID 20220304180105.409765-8-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/10] block: fix and cleanup bio_check_ro | expand

Commit Message

Christoph Hellwig March 4, 2022, 6:01 p.m. UTC
Use the %pg format specifier to save on stack consuption and code size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/raid1.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Song Liu March 4, 2022, 7:14 p.m. UTC | #1
On Fri, Mar 4, 2022 at 10:01 AM Christoph Hellwig <hch@lst.de> wrote:
>
> Use the %pg format specifier to save on stack consuption and code size.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Acked-by: Song Liu <song@kernel.org>

> ---
>  drivers/md/raid1.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index c180c188da574..97574575ad0b4 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -2069,15 +2069,14 @@ static int fix_sync_read_error(struct r1bio *r1_bio)
>                 } while (!success && d != r1_bio->read_disk);
>
>                 if (!success) {
> -                       char b[BDEVNAME_SIZE];
>                         int abort = 0;
>                         /* Cannot read from anywhere, this block is lost.
>                          * Record a bad block on each device.  If that doesn't
>                          * work just disable and interrupt the recovery.
>                          * Don't fail devices as that won't really help.
>                          */
> -                       pr_crit_ratelimited("md/raid1:%s: %s: unrecoverable I/O read error for block %llu\n",
> -                                           mdname(mddev), bio_devname(bio, b),
> +                       pr_crit_ratelimited("md/raid1:%s: %pg: unrecoverable I/O read error for block %llu\n",
> +                                           mdname(mddev), bio->bi_bdev,
>                                             (unsigned long long)r1_bio->sector);
>                         for (d = 0; d < conf->raid_disks * 2; d++) {
>                                 rdev = conf->mirrors[d].rdev;
> --
> 2.30.2
>
Chaitanya Kulkarni March 7, 2022, 3:06 a.m. UTC | #2
On 3/4/22 10:01, Christoph Hellwig wrote:
> Use the %pg format specifier to save on stack consuption and code size.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---


Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index c180c188da574..97574575ad0b4 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2069,15 +2069,14 @@  static int fix_sync_read_error(struct r1bio *r1_bio)
 		} while (!success && d != r1_bio->read_disk);
 
 		if (!success) {
-			char b[BDEVNAME_SIZE];
 			int abort = 0;
 			/* Cannot read from anywhere, this block is lost.
 			 * Record a bad block on each device.  If that doesn't
 			 * work just disable and interrupt the recovery.
 			 * Don't fail devices as that won't really help.
 			 */
-			pr_crit_ratelimited("md/raid1:%s: %s: unrecoverable I/O read error for block %llu\n",
-					    mdname(mddev), bio_devname(bio, b),
+			pr_crit_ratelimited("md/raid1:%s: %pg: unrecoverable I/O read error for block %llu\n",
+					    mdname(mddev), bio->bi_bdev,
 					    (unsigned long long)r1_bio->sector);
 			for (d = 0; d < conf->raid_disks * 2; d++) {
 				rdev = conf->mirrors[d].rdev;