Commit e515be8f authored by Xie Yongji's avatar Xie Yongji Committed by Jens Axboe

loop: Use invalidate_disk() helper to invalidate gendisk

Use invalidate_disk() helper to simplify the code for gendisk
invalidation.
Signed-off-by: default avatarXie Yongji <xieyongji@bytedance.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210922123711.187-3-xieyongji@bytedance.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f059a1d2
......@@ -1395,11 +1395,7 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
blk_queue_logical_block_size(lo->lo_queue, 512);
blk_queue_physical_block_size(lo->lo_queue, 512);
blk_queue_io_min(lo->lo_queue, 512);
if (bdev) {
invalidate_bdev(bdev);
bdev->bd_inode->i_mapping->wb_err = 0;
}
set_capacity(lo->lo_disk, 0);
invalidate_disk(lo->lo_disk);
loop_sysfs_exit(lo);
if (bdev) {
/* let user-space know about this change */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment