linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
Cc: Stefan Haberland <sth@linux.ibm.com>,
	Jan Hoeppner <hoeppner@linux.ibm.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>
Subject: Re: [PATCH 05/10] block: remove the disk argument from blk_drop_partitions
Date: Thu, 9 Apr 2020 11:33:25 +0000	[thread overview]
Message-ID: <SN4PR0401MB3598977E7D85FA660AD5A4519BC10@SN4PR0401MB3598.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20200408194439.1580699-6-hch@lst.de

On 08/04/2020 21:45, Christoph Hellwig wrote:
> -int blk_drop_partitions(struct gendisk *disk, struct block_device *bdev)
> +int blk_drop_partitions(struct block_device *bdev)
>   {
>   	struct disk_part_iter piter;
>   	struct hd_struct *part;
>   	int res;
>   
> -	if (!disk_part_scan_enabled(disk))
> +	if (!disk_part_scan_enabled(bdev->bd_disk))
>   		return 0;
>   	if (bdev->bd_part_count || bdev->bd_openers)
>   		return -EBUSY;
> -	res = invalidate_partition(disk, 0);
> +	res = invalidate_partition(bdev->bd_disk, 0);
>   	if (res)
>   		return res;
>   
> -	disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY);
> +	disk_part_iter_init(&piter, bdev->bd_disk, DISK_PITER_INCL_EMPTY);
>   	while ((part = disk_part_iter_next(&piter)))
> -		delete_partition(disk, part);
> +		delete_partition(bdev->bd_disk, part);
>   	disk_part_iter_exit(&piter);

I would have probably added a local 'struct gendisk *disk' variable, but 
that's personal preference I guess.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

  reply	other threads:[~2020-04-09 11:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 19:44 Christoph Hellwig
2020-04-08 19:44 ` [PATCH 01/10] block: refactor blkpg_ioctl Christoph Hellwig
2020-04-09 11:21   ` Johannes Thumshirn
2020-04-08 19:44 ` [PATCH 02/10] block: pass a hd_struct to delete_partition Christoph Hellwig
2020-04-09 11:27   ` Johannes Thumshirn
2020-04-09 12:02   ` Johannes Thumshirn
2020-04-08 19:44 ` [PATCH 03/10] block: cleanup hd_struct freeing Christoph Hellwig
2020-04-09 11:30   ` Johannes Thumshirn
2020-04-13 13:41     ` Christoph Hellwig
2020-04-08 19:44 ` [PATCH 04/10] block: remove hd_struct_kill Christoph Hellwig
2020-04-09 11:31   ` Johannes Thumshirn
2020-04-08 19:44 ` [PATCH 05/10] block: remove the disk argument from blk_drop_partitions Christoph Hellwig
2020-04-09 11:33   ` Johannes Thumshirn [this message]
2020-04-08 19:44 ` [PATCH 06/10] dasd: use blk_drop_partitions instead of badly reimplementing it Christoph Hellwig
2020-04-08 19:44 ` [PATCH 07/10] block: don't call invalidate_partition from blk_drop_partitions Christoph Hellwig
2020-04-08 19:44 ` [PATCH 08/10] block: simplify block device syncing in bdev_del_partition Christoph Hellwig
2020-04-09 12:01   ` Johannes Thumshirn
2020-04-08 19:44 ` [PATCH 09/10] block: mark invalidate_partition static Christoph Hellwig
2020-04-09 12:04   ` Johannes Thumshirn
2020-04-08 19:44 ` [PATCH 10/10] block: fold bdev_unhash_inode into invalidate_partition Christoph Hellwig
2020-04-09 12:06   ` Johannes Thumshirn
2020-04-14  7:28 more partition handling cleanups v2 Christoph Hellwig
2020-04-14  7:28 ` [PATCH 05/10] block: remove the disk argument from blk_drop_partitions Christoph Hellwig

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=SN4PR0401MB3598977E7D85FA660AD5A4519BC10@SN4PR0401MB3598.namprd04.prod.outlook.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=hoeppner@linux.ibm.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=sth@linux.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).