xen-blkfront.c: Convert to use set_capacity_revalidate_and_notify
authorBalbir Singh <sblbir@amazon.com>
Fri, 13 Mar 2020 05:30:07 +0000 (05:30 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Mar 2020 21:13:21 +0000 (15:13 -0600)
block/genhd provides set_capacity_revalidate_and_notify() for
sending RESIZE notifications via uevents.

Signed-off-by: Balbir Singh <sblbir@amazon.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/xen-blkfront.c

index 9df516a56bb2f80ee38f2fefecf5aac599e4fa11..915cf5b6388ce390d54be5c17446ed65d4cf581e 100644 (file)
@@ -2338,7 +2338,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;
        struct blkfront_ring_info *rinfo;
 
@@ -2354,10 +2353,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: