Thread (12 messages) 12 messages, 4 authors, 2020-03-12
STALE2323d
Revisions (2)
  1. v2 current
  2. v3 [diff vs current]

[PATCH v2 3/5] drivers/block/xen-blkfront.c: Convert to use set_capacity_revalidate_and_notify

From: Balbir Singh <hidden>
Date: 2020-02-25 20:01:51
Also in: linux-nvme, lkml
Subsystem: block layer, the rest, xen block subsystem, xen hypervisor interface · Maintainers: Jens Axboe, Linus Torvalds, Roger Pau Monné, Juergen Gross, Stefano Stabellini

block/genhd provides set_capacity_revalidate_and_notify() for
sending RESIZE notifications via uevents.

Signed-off-by: Balbir Singh <redacted>
---
 drivers/block/xen-blkfront.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index e2ad6bba2281..2f7cd842d6ce 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2335,7 +2335,6 @@ static void blkfront_connect(struct blkfront_info *info)
 	unsigned long sector_size;
 	unsigned int physical_sector_size;
 	unsigned int binfo;
-	char *envp[] = { "RESIZE=1", NULL };
 	int err, i;
 
 	switch (info->connected) {
@@ -2350,10 +2349,7 @@ static void blkfront_connect(struct blkfront_info *info)
 			return;
 		printk(KERN_INFO "Setting capacity to %Lu\n",
 		       sectors);
-		set_capacity(info->gd, sectors);
-		revalidate_disk(info->gd);
-		kobject_uevent_env(&disk_to_dev(info->gd)->kobj,
-				   KOBJ_CHANGE, envp);
+		set_capacity_revalidate_and_notify(info->gd, sectors, true);
 
 		return;
 	case BLKIF_STATE_SUSPENDED:
-- 
2.16.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help