diff options
author | Christoph Hellwig <hch@lst.de> | 2020-11-16 17:57:07 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-11-16 18:34:14 +0300 |
commit | e864e49af3a85797b51b36876087591602de2eb4 (patch) | |
tree | 406ac70053ed76984cb6f71c23919a46e35abd8d /drivers/block/rbd.c | |
parent | bc254eb44f9dfce278b53b714fb7bb963253789d (diff) | |
download | linux-e864e49af3a85797b51b36876087591602de2eb4.tar.xz |
rbd: use set_capacity_and_notify
Use set_capacity_and_notify to set the size of both the disk and block
device. This also gets the uevent notifications for the resize for free.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 671733e459cf..2ed79b09439a 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4888,8 +4888,7 @@ static void rbd_dev_update_size(struct rbd_device *rbd_dev) !test_bit(RBD_DEV_FLAG_REMOVING, &rbd_dev->flags)) { size = (sector_t)rbd_dev->mapping.size / SECTOR_SIZE; dout("setting size to %llu sectors", (unsigned long long)size); - set_capacity(rbd_dev->disk, size); - revalidate_disk_size(rbd_dev->disk, true); + set_capacity_and_notify(rbd_dev->disk, size); } } |