Commit d46430bf authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: remove the disk argument from blk_drop_partitions

The gendisk can be trivially deducted from the block_device.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 4377b48d
...@@ -603,23 +603,23 @@ static bool disk_unlock_native_capacity(struct gendisk *disk) ...@@ -603,23 +603,23 @@ static bool disk_unlock_native_capacity(struct gendisk *disk)
} }
} }
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 disk_part_iter piter;
struct hd_struct *part; struct hd_struct *part;
int res; int res;
if (!disk_part_scan_enabled(disk)) if (!disk_part_scan_enabled(bdev->bd_disk))
return 0; return 0;
if (bdev->bd_part_count || bdev->bd_openers > 1) if (bdev->bd_part_count || bdev->bd_openers > 1)
return -EBUSY; return -EBUSY;
res = invalidate_partition(disk, 0); res = invalidate_partition(bdev->bd_disk, 0);
if (res) if (res)
return 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))) while ((part = disk_part_iter_next(&piter)))
delete_partition(disk, part); delete_partition(bdev->bd_disk, part);
disk_part_iter_exit(&piter); disk_part_iter_exit(&piter);
return 0; return 0;
......
...@@ -1517,7 +1517,7 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate) ...@@ -1517,7 +1517,7 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)
lockdep_assert_held(&bdev->bd_mutex); lockdep_assert_held(&bdev->bd_mutex);
rescan: rescan:
ret = blk_drop_partitions(disk, bdev); ret = blk_drop_partitions(bdev);
if (ret) if (ret)
return ret; return ret;
......
...@@ -339,7 +339,7 @@ extern dev_t blk_lookup_devt(const char *name, int partno); ...@@ -339,7 +339,7 @@ extern dev_t blk_lookup_devt(const char *name, int partno);
int bdev_disk_changed(struct block_device *bdev, bool invalidate); int bdev_disk_changed(struct block_device *bdev, bool invalidate);
int blk_add_partitions(struct gendisk *disk, struct block_device *bdev); int blk_add_partitions(struct gendisk *disk, struct block_device *bdev);
int blk_drop_partitions(struct gendisk *disk, struct block_device *bdev); int blk_drop_partitions(struct block_device *bdev);
extern void printk_all_partitions(void); extern void printk_all_partitions(void);
extern struct gendisk *__alloc_disk_node(int minors, int node_id); extern struct gendisk *__alloc_disk_node(int minors, int node_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment