Commit 662155e2 authored by Balbir Singh's avatar Balbir Singh Committed by Jens Axboe

virtio_blk.c: Convert to use set_capacity_revalidate_and_notify

block/genhd provides set_capacity_revalidate_and_notify() for sending RESIZE
notifications via uevents.
Signed-off-by: default avatarBalbir Singh <sblbir@amazon.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e598a72f
...@@ -381,18 +381,15 @@ static void virtblk_update_capacity(struct virtio_blk *vblk, bool resize) ...@@ -381,18 +381,15 @@ static void virtblk_update_capacity(struct virtio_blk *vblk, bool resize)
cap_str_10, cap_str_10,
cap_str_2); cap_str_2);
set_capacity(vblk->disk, capacity); set_capacity_revalidate_and_notify(vblk->disk, capacity, true);
} }
static void virtblk_config_changed_work(struct work_struct *work) static void virtblk_config_changed_work(struct work_struct *work)
{ {
struct virtio_blk *vblk = struct virtio_blk *vblk =
container_of(work, struct virtio_blk, config_work); container_of(work, struct virtio_blk, config_work);
char *envp[] = { "RESIZE=1", NULL };
virtblk_update_capacity(vblk, true); virtblk_update_capacity(vblk, true);
revalidate_disk(vblk->disk);
kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp);
} }
static void virtblk_config_changed(struct virtio_device *vdev) static void virtblk_config_changed(struct virtio_device *vdev)
......
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