All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	axboe@kernel.dk, viro@zeniv.linux.org.uk, dm-devel@redhat.com
Subject: Re: [PATCH 6/7] block/partitions: use block_device name vsprintf helper v2
Date: Tue, 14 Apr 2015 11:23:45 +0200	[thread overview]
Message-ID: <20150414092345.GH23327@quack.suse.cz> (raw)
In-Reply-To: <1428928300-9132-7-git-send-email-dmonakhov@openvz.org>

On Mon 13-04-15 16:31:39, Dmitry Monakhov wrote:
> - bdevname() now works via "%pg" format specifier (in responce to Joe's comments)
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
  Looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  block/partition-generic.c |    3 ++-
>  block/partitions/amiga.c  |   13 ++++++-------
>  block/partitions/sgi.c    |    9 ++++-----
>  block/partitions/sun.c    |    9 ++++-----
>  4 files changed, 16 insertions(+), 18 deletions(-)
> 
> diff --git a/block/partition-generic.c b/block/partition-generic.c
> index 0d9e5f9..ae67f16 100644
> --- a/block/partition-generic.c
> +++ b/block/partition-generic.c
> @@ -45,7 +45,8 @@ char *disk_name(struct gendisk *hd, int partno, char *buf)
>  
>  const char *bdevname(struct block_device *bdev, char *buf)
>  {
> -	return disk_name(bdev->bd_disk, bdev->bd_part->partno, buf);
> +	snprintf(buf, BDEVNAME_SIZE, "%pg", bdev);
> +	return buf;
>  }
>  
>  EXPORT_SYMBOL(bdevname);
> diff --git a/block/partitions/amiga.c b/block/partitions/amiga.c
> index 2b13533..240f4f6 100644
> --- a/block/partitions/amiga.c
> +++ b/block/partitions/amiga.c
> @@ -34,7 +34,6 @@ int amiga_partition(struct parsed_partitions *state)
>  	int start_sect, nr_sects, blk, part, res = 0;
>  	int blksize = 1;	/* Multiplier for disk block size */
>  	int slot = 1;
> -	char b[BDEVNAME_SIZE];
>  
>  	for (blk = 0; ; blk++, put_dev_sector(sect)) {
>  		if (blk == RDB_ALLOCATION_LIMIT)
> @@ -42,8 +41,8 @@ int amiga_partition(struct parsed_partitions *state)
>  		data = read_part_sector(state, blk, &sect);
>  		if (!data) {
>  			if (warn_no_part)
> -				pr_err("Dev %s: unable to read RDB block %d\n",
> -				       bdevname(state->bdev, b), blk);
> +				pr_err("Dev %pg: unable to read RDB block %d\n",
> +				       state->bdev, blk);
>  			res = -1;
>  			goto rdb_done;
>  		}
> @@ -64,8 +63,8 @@ int amiga_partition(struct parsed_partitions *state)
>  			break;
>  		}
>  
> -		pr_err("Dev %s: RDB in block %d has bad checksum\n",
> -		       bdevname(state->bdev, b), blk);
> +		pr_err("Dev %pg: RDB in block %d has bad checksum\n",
> +		       state->bdev, blk);
>  	}
>  
>  	/* blksize is blocks per 512 byte standard block */
> @@ -85,8 +84,8 @@ int amiga_partition(struct parsed_partitions *state)
>  		data = read_part_sector(state, blk, &sect);
>  		if (!data) {
>  			if (warn_no_part)
> -				pr_err("Dev %s: unable to read partition block %d\n",
> -				       bdevname(state->bdev, b), blk);
> +				pr_err("Dev %pg: unable to read partition block %d\n",
> +				       state->bdev, blk);
>  			res = -1;
>  			goto rdb_done;
>  		}
> diff --git a/block/partitions/sgi.c b/block/partitions/sgi.c
> index ea8a86d..b040277 100644
> --- a/block/partitions/sgi.c
> +++ b/block/partitions/sgi.c
> @@ -37,7 +37,6 @@ int sgi_partition(struct parsed_partitions *state)
>  	Sector sect;
>  	struct sgi_disklabel *label;
>  	struct sgi_partition *p;
> -	char b[BDEVNAME_SIZE];
>  
>  	label = read_part_sector(state, 0, &sect);
>  	if (!label)
> @@ -45,8 +44,8 @@ int sgi_partition(struct parsed_partitions *state)
>  	p = &label->partitions[0];
>  	magic = label->magic_mushroom;
>  	if(be32_to_cpu(magic) != SGI_LABEL_MAGIC) {
> -		/*printk("Dev %s SGI disklabel: bad magic %08x\n",
> -		       bdevname(bdev, b), be32_to_cpu(magic));*/
> +		/*printk("Dev %pg SGI disklabel: bad magic %08x\n",
> +		       bdev, be32_to_cpu(magic));*/
>  		put_dev_sector(sect);
>  		return 0;
>  	}
> @@ -56,8 +55,8 @@ int sgi_partition(struct parsed_partitions *state)
>  		csum += be32_to_cpu(cs);
>  	}
>  	if(csum) {
> -		printk(KERN_WARNING "Dev %s SGI disklabel: csum bad, label corrupted\n",
> -		       bdevname(state->bdev, b));
> +		printk(KERN_WARNING "Dev %pg SGI disklabel: csum bad, label corrupted\n",
> +		       state->bdev);
>  		put_dev_sector(sect);
>  		return 0;
>  	}
> diff --git a/block/partitions/sun.c b/block/partitions/sun.c
> index b5b6fcf..25343d6 100644
> --- a/block/partitions/sun.c
> +++ b/block/partitions/sun.c
> @@ -57,7 +57,6 @@ int sun_partition(struct parsed_partitions *state)
>  	} * label;
>  	struct sun_partition *p;
>  	unsigned long spc;
> -	char b[BDEVNAME_SIZE];
>  	int use_vtoc;
>  	int nparts;
>  
> @@ -67,8 +66,8 @@ int sun_partition(struct parsed_partitions *state)
>  
>  	p = label->partitions;
>  	if (be16_to_cpu(label->magic) != SUN_LABEL_MAGIC) {
> -/*		printk(KERN_INFO "Dev %s Sun disklabel: bad magic %04x\n",
> -		       bdevname(bdev, b), be16_to_cpu(label->magic)); */
> +/*		printk(KERN_INFO "Dev %pg Sun disklabel: bad magic %04x\n",
> +		       bdev, be16_to_cpu(label->magic)); */
>  		put_dev_sector(sect);
>  		return 0;
>  	}
> @@ -77,8 +76,8 @@ int sun_partition(struct parsed_partitions *state)
>  	for (csum = 0; ush >= ((__be16 *) label);)
>  		csum ^= *ush--;
>  	if (csum) {
> -		printk("Dev %s Sun disklabel: Csum bad, label corrupted\n",
> -		       bdevname(state->bdev, b));
> +		printk("Dev %pg Sun disklabel: Csum bad, label corrupted\n",
> +		       state->bdev);
>  		put_dev_sector(sect);
>  		return 0;
>  	}
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2015-04-14  9:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 12:31 [PATCH 0/7] fs: add blkdev name format specifier v2 Dmitry Monakhov
2015-04-13 12:31 ` [PATCH 1/7] fs: use gendisk->disk_name where possible Dmitry Monakhov
2015-04-13 12:31   ` Dmitry Monakhov
2015-04-14  9:13   ` Jan Kara
2015-04-13 12:31 ` [PATCH 2/7] lib/vsprintf: add %*pg format specifier Dmitry Monakhov
2015-04-14  9:15   ` Jan Kara
2015-04-13 12:31 ` [PATCH 3/7] block: use block_device name vsprintf helper Dmitry Monakhov
2015-04-14  9:16   ` Jan Kara
2015-04-13 12:31 ` [PATCH 4/7] fs: " Dmitry Monakhov
2015-04-13 12:31   ` Dmitry Monakhov
2015-04-14  9:22   ` Jan Kara
2015-04-13 12:31 ` [PATCH 5/7] md: " Dmitry Monakhov
2015-04-13 12:31   ` Dmitry Monakhov
2015-04-14  9:43   ` Jan Kara
2015-04-13 12:31 ` [PATCH 6/7] block/partitions: use block_device name vsprintf helper v2 Dmitry Monakhov
2015-04-13 12:31   ` Dmitry Monakhov
2015-04-14  9:23   ` Jan Kara [this message]
2015-04-13 12:31 ` [PATCH 7/7] drivers: use block_device name vsprintf helper Dmitry Monakhov
2015-04-14  9:24   ` Jan Kara

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=20150414092345.GH23327@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=dmonakhov@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.