diff options
author | Christoph Hellwig <hch@lst.de> | 2021-04-06 08:22:54 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-04-08 18:24:36 +0200 |
commit | 473338be3aaea117a7133720305f240eb7f68951 (patch) | |
tree | 254b617fa5e8fb02fc8264df93ed77733af50d82 /block/genhd.c | |
parent | block: remove invalidate_partition (diff) | |
download | linux-473338be3aaea117a7133720305f240eb7f68951.tar.xz linux-473338be3aaea117a7133720305f240eb7f68951.zip |
block: move more syncing and invalidation to delete_partition
Move the calls to fsync_bdev and __invalidate_device from del_gendisk to
delete_partition. For the other two callers that check that there are
no openers for the delete partitions(s) the callouts are a no-op as no
file system can be mounted, but this keeps all the cleanup in one
place.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210406062303.811835-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/block/genhd.c b/block/genhd.c index 9b121b1f7998..15f99da4543f 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -686,11 +686,8 @@ void del_gendisk(struct gendisk *disk) /* invalidate stuff */ disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY); - while ((part = disk_part_iter_next(&piter))) { - fsync_bdev(part); - __invalidate_device(part, true); + while ((part = disk_part_iter_next(&piter))) delete_partition(part); - } disk_part_iter_exit(&piter); fsync_bdev(disk->part0); |