Commit 3b4f85d0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

loop: let set_capacity_revalidate_and_notify update the bdev size

There is no good reason to call revalidate_disk_size separately.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 99473d9d
......@@ -251,12 +251,8 @@ loop_validate_block_size(unsigned short bsize)
*/
static void loop_set_size(struct loop_device *lo, loff_t size)
{
struct block_device *bdev = lo->lo_device;
bd_set_nr_sectors(bdev, size);
if (!set_capacity_revalidate_and_notify(lo->lo_disk, size, false))
kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE);
if (!set_capacity_revalidate_and_notify(lo->lo_disk, size, true))
kobject_uevent(&disk_to_dev(lo->lo_disk)->kobj, KOBJ_CHANGE);
}
static inline int
......
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