Skip to content

Commit

Permalink
xen-blkfront.c: Convert to use set_capacity_revalidate_and_notify
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Balbir Singh authored and Jens Axboe committed Mar 18, 2020
1 parent 662155e commit 3cbc28b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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:
Expand Down

0 comments on commit 3cbc28b

Please sign in to comment.