]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - block/genhd.c
block/genhd: Notify udev about capacity change
authorBalbir Singh <sblbir@amazon.com>
Fri, 13 Mar 2020 05:30:05 +0000 (05:30 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Mar 2020 21:13:21 +0000 (15:13 -0600)
commite598a72faeb543599bdf0d930df3a71906404e6f
tree140f53a0a76614caf6c1bfddfdd883cc2f887ae0
parentde6a78b601c529398ad1448e3bffcade1fcf5a70
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>
block/genhd.c
include/linux/genhd.h