aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-16 15:57:06 +0100
committerJens Axboe <axboe@kernel.dk>2020-11-16 08:34:14 -0700
commitbc254eb44f9dfce278b53b714fb7bb963253789d (patch)
tree6b16a64e8177c50fa76ff9237c8ba3a3d98301b8 /drivers/block/drbd/drbd_main.c
parentnvme: use set_capacity_and_notify in nvme_set_queue_dying (diff)
downloadlinux-dev-bc254eb44f9dfce278b53b714fb7bb963253789d.tar.xz
linux-dev-bc254eb44f9dfce278b53b714fb7bb963253789d.zip
drbd: 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> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r--drivers/block/drbd/drbd_main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 65b95aef8dbc..1c8c18b2a25f 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2036,8 +2036,7 @@ void drbd_set_my_capacity(struct drbd_device *device, sector_t size)
{
char ppb[10];
- set_capacity(device->vdisk, size);
- revalidate_disk_size(device->vdisk, false);
+ set_capacity_and_notify(device->vdisk, size);
drbd_info(device, "size = %s (%llu KB)\n",
ppsize(ppb, size>>1), (unsigned long long)size>>1);
@@ -2068,8 +2067,7 @@ void drbd_device_cleanup(struct drbd_device *device)
}
D_ASSERT(device, first_peer_device(device)->connection->net_conf == NULL);
- set_capacity(device->vdisk, 0);
- revalidate_disk_size(device->vdisk, false);
+ set_capacity_and_notify(device->vdisk, 0);
if (device->bitmap) {
/* maybe never allocated. */
drbd_bm_resize(device, 0, 1);