block: add a helper to raise a media changed event
authorMatteo Croce <mcroce@microsoft.com>
Mon, 12 Jul 2021 23:05:29 +0000 (01:05 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 Aug 2021 19:37:28 +0000 (13:37 -0600)
commite6138dc12de9df17cbda9c40314d69592855ac5e
tree99a181542ec3a0328a4fbb28a51b53834fc52813
parent13927b31b13f3c6556221eff3487247bd3c7a245
block: add a helper to raise a media changed event

Refactor disk_check_events() and move some code into disk_event_uevent().
Then add disk_force_media_change(), a helper which will be used by
devices to force issuing a DISK_EVENT_MEDIA_CHANGE event.

Co-developed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Matteo Croce <mcroce@microsoft.com>
Tested-by: Luca Boccassi <bluca@debian.org>
Link: https://lore.kernel.org/r/20210712230530.29323-6-mcroce@linux.microsoft.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/disk-events.c
include/linux/genhd.h