diff options
author | Balbir Singh <sblbir@amazon.com> | 2020-03-13 08:30:05 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-03-19 00:13:21 +0300 |
commit | e598a72faeb543599bdf0d930df3a71906404e6f (patch) | |
tree | 140f53a0a76614caf6c1bfddfdd883cc2f887ae0 /include | |
parent | de6a78b601c529398ad1448e3bffcade1fcf5a70 (diff) | |
download | linux-e598a72faeb543599bdf0d930df3a71906404e6f.tar.xz |
block/genhd: Notify udev about capacity change
Allow block/genhd to notify user space (via udev) about disk size changes
using a new helper set_capacity_revalidate_and_notify(), which is a wrapper
on top of set_capacity(). set_capacity_revalidate_and_notify() will only
notify via udev if the current capacity or the target capacity is not zero
and iff the capacity changes.
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Someswarudu Sangaraju <ssomesh@amazon.com>
Signed-off-by: Balbir Singh <sblbir@amazon.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/genhd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index e7244fb6b6ad..3c1a816785c8 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -508,6 +508,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); extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); /* drivers/char/random.c */ |