Commit 3cbc28bb authored by Balbir Singh's avatar Balbir Singh Committed by Jens Axboe
Browse files

xen-blkfront.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: default avatarBalbir Singh <sblbir@amazon.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 662155e2
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -2338,7 +2338,6 @@ static void blkfront_connect(struct blkfront_info *info)
	unsigned long sector_size;
	unsigned long sector_size;
	unsigned int physical_sector_size;
	unsigned int physical_sector_size;
	unsigned int binfo;
	unsigned int binfo;
	char *envp[] = { "RESIZE=1", NULL };
	int err, i;
	int err, i;
	struct blkfront_ring_info *rinfo;
	struct blkfront_ring_info *rinfo;


@@ -2354,10 +2353,7 @@ static void blkfront_connect(struct blkfront_info *info)
			return;
			return;
		printk(KERN_INFO "Setting capacity to %Lu\n",
		printk(KERN_INFO "Setting capacity to %Lu\n",
		       sectors);
		       sectors);
		set_capacity(info->gd, sectors);
		set_capacity_revalidate_and_notify(info->gd, sectors, true);
		revalidate_disk(info->gd);
		kobject_uevent_env(&disk_to_dev(info->gd)->kobj,
				   KOBJ_CHANGE, envp);


		return;
		return;
	case BLKIF_STATE_SUSPENDED:
	case BLKIF_STATE_SUSPENDED: