Skip to content

Commit

Permalink
block: use revalidate_disk_size in set_capacity_revalidate_and_notify
Browse files Browse the repository at this point in the history
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: Christoph Hellwig <[email protected]>
Reviewed-by: Josef Bacik <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Sep 2, 2020
1 parent 659e56b commit b8086d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ static void disk_release_events(struct gendisk *disk);
* zero and will not be set to zero
*/
void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
bool revalidate)
bool update_bdev)
{
sector_t capacity = get_capacity(disk);

set_capacity(disk, size);

if (revalidate)
revalidate_disk(disk);
if (update_bdev)
revalidate_disk_size(disk, true);

if (capacity != size && capacity != 0 && size != 0) {
char *envp[] = { "RESIZE=1", NULL };
Expand Down
4 changes: 2 additions & 2 deletions include/linux/genhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ static inline int get_disk_ro(struct gendisk *disk)
extern void disk_block_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 set_capacity_revalidate_and_notify(struct gendisk *disk,
sector_t size, bool revalidate);
void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
bool update_bdev);
extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask);

/* drivers/char/random.c */
Expand Down

0 comments on commit b8086d3

Please sign in to comment.