diff options
author | Christoph Hellwig <hch@lst.de> | 2020-08-31 20:02:38 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-09-01 19:38:25 -0600 |
commit | 8328eb28369a7dbfab6ff26366dbe8094425acc4 (patch) | |
tree | ceb69fab0917d83089c0bb53acb1921009cc6be3 /block/partitions | |
parent | f93af2a494e1d28377065a2320d11da98110a970 (diff) |
block: remove the disk argument to delete_partition
We can trivially derive the gendisk from the hd_struct.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/partitions')
-rw-r--r-- | block/partitions/core.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c index e596a85bba1e..dd6811422a87 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -324,8 +324,9 @@ int hd_ref_init(struct hd_struct *part) * Must be called either with bd_mutex held, before a disk can be opened or * after all disk users are gone. */ -void delete_partition(struct gendisk *disk, struct hd_struct *part) +void delete_partition(struct hd_struct *part) { + struct gendisk *disk = part_to_disk(part); struct disk_part_tbl *ptbl = rcu_dereference_protected(disk->part_tbl, 1); @@ -333,7 +334,7 @@ void delete_partition(struct gendisk *disk, struct hd_struct *part) * ->part_tbl is referenced in this part's release handler, so * we have to hold the disk device */ - get_device(disk_to_dev(part_to_disk(part))); + get_device(disk_to_dev(disk)); rcu_assign_pointer(ptbl->part[part->partno], NULL); kobject_put(part->holder_dir); device_del(part_to_dev(part)); @@ -556,7 +557,7 @@ int bdev_del_partition(struct block_device *bdev, int partno) sync_blockdev(bdevp); invalidate_bdev(bdevp); - delete_partition(bdev->bd_disk, part); + delete_partition(part); ret = 0; out_unlock: mutex_unlock(&bdev->bd_mutex); @@ -636,7 +637,7 @@ int blk_drop_partitions(struct block_device *bdev) disk_part_iter_init(&piter, bdev->bd_disk, DISK_PITER_INCL_EMPTY); while ((part = disk_part_iter_next(&piter))) - delete_partition(bdev->bd_disk, part); + delete_partition(part); disk_part_iter_exit(&piter); return 0; |