Skip to content

Commit

Permalink
virtio_blk.c: Convert to use set_capacity_revalidate_and_notify
Browse files Browse the repository at this point in the history
block/genhd provides set_capacity_revalidate_and_notify() for sending RESIZE
notifications via uevents.

Signed-off-by: Balbir Singh <sblbir@amazon.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Balbir Singh authored and Jens Axboe committed Mar 18, 2020
1 parent e598a72 commit 662155e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,18 +381,15 @@ static void virtblk_update_capacity(struct virtio_blk *vblk, bool resize)
cap_str_10,
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)
{
struct virtio_blk *vblk =
container_of(work, struct virtio_blk, config_work);
char *envp[] = { "RESIZE=1", NULL };

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)
Expand Down

0 comments on commit 662155e

Please sign in to comment.