Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Christoph Hellwig and committed by
Jens Axboe
00080f7f eec1be4c

+4 -12
+4 -12
block/partitions/core.c
··· 524 524 return true; 525 525 } 526 526 527 - static void blk_drop_partitions(struct gendisk *disk) 528 - { 529 - struct block_device *part; 530 - unsigned long idx; 531 - 532 - lockdep_assert_held(&disk->open_mutex); 533 - 534 - xa_for_each_start(&disk->part_tbl, idx, part, 1) 535 - delete_partition(part); 536 - } 537 - 538 527 static bool blk_add_partition(struct gendisk *disk, 539 528 struct parsed_partitions *state, int p) 540 529 { ··· 640 651 641 652 int bdev_disk_changed(struct gendisk *disk, bool invalidate) 642 653 { 654 + struct block_device *part; 655 + unsigned long idx; 643 656 int ret = 0; 644 657 645 658 lockdep_assert_held(&disk->open_mutex); ··· 654 663 return -EBUSY; 655 664 sync_blockdev(disk->part0); 656 665 invalidate_bdev(disk->part0); 657 - blk_drop_partitions(disk); 658 666 667 + xa_for_each_start(&disk->part_tbl, idx, part, 1) 668 + delete_partition(part); 659 669 clear_bit(GD_NEED_PART_SCAN, &disk->state); 660 670 661 671 /*