[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200225200129.6687-3-sblbir@amazon.com>
Date: Tue, 25 Feb 2020 20:01:26 +0000
From: Balbir Singh <sblbir@...zon.com>
To: <linux-kernel@...r.kernel.org>, <linux-block@...r.kernel.org>,
<linux-nvme@...ts.infradead.org>
CC: <axboe@...nel.dk>, <Chaitanya.Kulkarni@....com>, <mst@...hat.com>,
<jejb@...ux.ibm.com>, <hch@....de>,
Balbir Singh <sblbir@...zon.com>
Subject: [PATCH v2 2/5] drivers/block/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: Balbir Singh <sblbir@...zon.com>
---
drivers/block/virtio_blk.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 54158766334b..c913ebb25a52 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -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)
--
2.16.6
Powered by blists - more mailing lists