Skip to content

Commit 63c38d8

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove the bdgrab in blk_drop_partitions
There is no need to hold a bdev reference when removing the partition. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20210701081638.246552-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 498dcc1 commit 63c38d8

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

block/partitions/core.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,12 +546,8 @@ void blk_drop_partitions(struct gendisk *disk)
546546

547547
lockdep_assert_held(&disk->open_mutex);
548548

549-
xa_for_each_start(&disk->part_tbl, idx, part, 1) {
550-
if (!bdgrab(part))
551-
continue;
549+
xa_for_each_start(&disk->part_tbl, idx, part, 1)
552550
delete_partition(part);
553-
bdput(part);
554-
}
555551
}
556552

557553
static bool blk_add_partition(struct gendisk *disk,

0 commit comments

Comments
 (0)