The only interesting state here is ev->clearing, and that is protected by
ev->lock already.
Signed-off-by: Christoph Hellwig <hch@lst.de>
* event. This is to ensure detection of media removal commanded
* from userland - e.g. eject(1).
*/
- mutex_lock(&disk->open_mutex);
disk_flush_events(disk, DISK_EVENT_MEDIA_CHANGE);
+ mutex_lock(&disk->open_mutex);
if (bdev_is_partition(bdev))
blkdev_put_part(bdev, mode);
else
* Schedule immediate event checking on @disk if not blocked. Events in
* @mask are scheduled to be cleared from the driver. Note that this
* doesn't clear the events from @disk->ev.
- *
- * CONTEXT:
- * If @mask is non-zero must be called with disk->open_mutex held.
*/
void disk_flush_events(struct gendisk *disk, unsigned int mask)
{