Commit b8086d3f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: use revalidate_disk_size in set_capacity_revalidate_and_notify

Only virtio_blk and xen-blkfront set the revalidate argument to true,
and both do not implement the ->revalidate_disk method.  So switch
to the helper that just updates the size instead.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 659e56ba
...@@ -50,14 +50,13 @@ static void disk_release_events(struct gendisk *disk); ...@@ -50,14 +50,13 @@ static void disk_release_events(struct gendisk *disk);
* zero and will not be set to zero * zero and will not be set to zero
*/ */
void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size, void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
bool revalidate) bool update_bdev)
{ {
sector_t capacity = get_capacity(disk); sector_t capacity = get_capacity(disk);
set_capacity(disk, size); set_capacity(disk, size);
if (update_bdev)
if (revalidate) revalidate_disk_size(disk, true);
revalidate_disk(disk);
if (capacity != size && capacity != 0 && size != 0) { if (capacity != size && capacity != 0 && size != 0) {
char *envp[] = { "RESIZE=1", NULL }; char *envp[] = { "RESIZE=1", NULL };
......
...@@ -313,8 +313,8 @@ static inline int get_disk_ro(struct gendisk *disk) ...@@ -313,8 +313,8 @@ static inline int get_disk_ro(struct gendisk *disk)
extern void disk_block_events(struct gendisk *disk); extern void disk_block_events(struct gendisk *disk);
extern void disk_unblock_events(struct gendisk *disk); extern void disk_unblock_events(struct gendisk *disk);
extern void disk_flush_events(struct gendisk *disk, unsigned int mask); extern void disk_flush_events(struct gendisk *disk, unsigned int mask);
extern void set_capacity_revalidate_and_notify(struct gendisk *disk, void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
sector_t size, bool revalidate); bool update_bdev);
extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask);
/* drivers/char/random.c */ /* drivers/char/random.c */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment