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>