block: remove blk_drop_partitions
There is only a single caller left, so fold the loop into that. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Acked-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Link: https://lore.kernel.org/r/20230601094459.1350643-9-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Родитель
eec1be4c30
Коммит
00080f7fb7
|
@ -524,17 +524,6 @@ static bool disk_unlock_native_capacity(struct gendisk *disk)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void blk_drop_partitions(struct gendisk *disk)
|
|
||||||
{
|
|
||||||
struct block_device *part;
|
|
||||||
unsigned long idx;
|
|
||||||
|
|
||||||
lockdep_assert_held(&disk->open_mutex);
|
|
||||||
|
|
||||||
xa_for_each_start(&disk->part_tbl, idx, part, 1)
|
|
||||||
delete_partition(part);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool blk_add_partition(struct gendisk *disk,
|
static bool blk_add_partition(struct gendisk *disk,
|
||||||
struct parsed_partitions *state, int p)
|
struct parsed_partitions *state, int p)
|
||||||
{
|
{
|
||||||
|
@ -651,6 +640,8 @@ out_free_state:
|
||||||
|
|
||||||
int bdev_disk_changed(struct gendisk *disk, bool invalidate)
|
int bdev_disk_changed(struct gendisk *disk, bool invalidate)
|
||||||
{
|
{
|
||||||
|
struct block_device *part;
|
||||||
|
unsigned long idx;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
lockdep_assert_held(&disk->open_mutex);
|
lockdep_assert_held(&disk->open_mutex);
|
||||||
|
@ -663,8 +654,9 @@ rescan:
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
sync_blockdev(disk->part0);
|
sync_blockdev(disk->part0);
|
||||||
invalidate_bdev(disk->part0);
|
invalidate_bdev(disk->part0);
|
||||||
blk_drop_partitions(disk);
|
|
||||||
|
|
||||||
|
xa_for_each_start(&disk->part_tbl, idx, part, 1)
|
||||||
|
delete_partition(part);
|
||||||
clear_bit(GD_NEED_PART_SCAN, &disk->state);
|
clear_bit(GD_NEED_PART_SCAN, &disk->state);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче