Re: [PATCH 05/10] block: remove the disk argument from blk_drop_partitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux