diff options
author | Christoph Hellwig <hch@lst.de> | 2023-08-11 12:08:19 +0200 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-08-21 14:35:30 +0200 |
commit | ab6860f62bfe329e11e5b5b7295b673c9c3a62d0 (patch) | |
tree | 72b68badcd687dd3ed5928dc33319b98ddbd167e /block | |
parent | nbd: call blk_mark_disk_dead in nbd_clear_sock_ioctl (diff) | |
download | linux-ab6860f62bfe329e11e5b5b7295b673c9c3a62d0.tar.xz linux-ab6860f62bfe329e11e5b5b7295b673c9c3a62d0.zip |
block: simplify the disk_force_media_change interface
Hard code the events to DISK_EVENT_MEDIA_CHANGE as that is the only
useful use case, and drop the superfluous return value.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Message-Id: <20230811100828.1897174-9-hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'block')
-rw-r--r-- | block/disk-events.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/block/disk-events.c b/block/disk-events.c index 0cfac464e6d1..6189b819b235 100644 --- a/block/disk-events.c +++ b/block/disk-events.c @@ -294,25 +294,18 @@ EXPORT_SYMBOL(disk_check_media_change); * @disk: the disk which will raise the event * @events: the events to raise * - * Generate uevents for the disk. If DISK_EVENT_MEDIA_CHANGE is present, - * attempt to free all dentries and inodes and invalidates all block + * Should be called when the media changes for @disk. Generates a uevent + * and attempts to free all dentries and inodes and invalidates all block * device page cache entries in that case. - * - * Returns %true if DISK_EVENT_MEDIA_CHANGE was raised, or %false if not. */ -bool disk_force_media_change(struct gendisk *disk, unsigned int events) +void disk_force_media_change(struct gendisk *disk) { - disk_event_uevent(disk, events); - - if (!(events & DISK_EVENT_MEDIA_CHANGE)) - return false; - + disk_event_uevent(disk, DISK_EVENT_MEDIA_CHANGE); inc_diskseq(disk); if (__invalidate_device(disk->part0, true)) pr_warn("VFS: busy inodes on changed media %s\n", disk->disk_name); set_bit(GD_NEED_PART_SCAN, &disk->state); - return true; } EXPORT_SYMBOL_GPL(disk_force_media_change); |