summaryrefslogtreecommitdiffstats
path: root/block/partitions/core.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-04-14 09:28:57 +0200
committerJens Axboe <axboe@kernel.dk>2020-04-20 11:32:59 -0600
commitd46430bf5a2298f55e20f59a90ebe3545d273b2f (patch)
tree99288a751fbe2e0502be81719f4ccc3144e797c6 /block/partitions/core.c
parent4377b48da6da44360cc76cd3e0562dbb47dd4904 (diff)
downloadlinux-d46430bf5a2298f55e20f59a90ebe3545d273b2f.tar.gz
linux-d46430bf5a2298f55e20f59a90ebe3545d273b2f.tar.bz2
linux-d46430bf5a2298f55e20f59a90ebe3545d273b2f.zip
block: remove the disk argument from blk_drop_partitions
The gendisk can be trivially deducted from the block_device. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/partitions/core.c')
-rw-r--r--block/partitions/core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 7d062599aa33..deccc3fbcd37 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -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 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 > 1)
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);
return 0;