diff options
author | Martijn Coenen <maco@android.com> | 2020-05-13 15:38:38 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-05-21 16:20:34 +0200 |
commit | 716ad0986cbd1d3b2ab3f6d23144a94638dac20b (patch) | |
tree | 6da8fb59b059b6dc1270a6f9a7e211cdeadd2d79 /drivers/block/loop.c | |
parent | loop: Factor out setting loop device size (diff) | |
download | linux-716ad0986cbd1d3b2ab3f6d23144a94638dac20b.tar.xz linux-716ad0986cbd1d3b2ab3f6d23144a94638dac20b.zip |
loop: Switch to set_capacity_revalidate_and_notify()
This was recently added to block/genhd.c, and takes care of both
updating the capacity and notifying userspace of the new size.
Signed-off-by: Martijn Coenen <maco@android.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r-- | drivers/block/loop.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index e69ff3c19eff..d9a756f8abd5 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -240,10 +240,9 @@ static void loop_set_size(struct loop_device *lo, loff_t size) { struct block_device *bdev = lo->lo_device; - set_capacity(lo->lo_disk, size); bd_set_size(bdev, size << SECTOR_SHIFT); - /* let user-space know about the new size */ - kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE); + + set_capacity_revalidate_and_notify(lo->lo_disk, size, false); } static void |