Lines Matching full:events
3 * Disk events - monitor disk events like media change and eject request.
17 unsigned int pending; /* events already sent out */
18 unsigned int clearing; /* events being cleared */
60 * @disk: disk to block events for
64 * disk_unblock_events(). Events blocking is counted and the actual
125 * @disk: disk to unblock events for
128 * starts events polling if configured.
141 * @disk: disk to check and flush events for
142 * @mask: events to flush
144 * Schedule immediate event checking on @disk if not blocked. Events in
146 * doesn't clear the events from @disk->ev.
167 * Tell userland about new events. Only the events listed in @disk->events are
168 * reported, and only if DISK_EVENT_FLAG_UEVENT is set. Otherwise, events are
171 static void disk_event_uevent(struct gendisk *disk, unsigned int events) in disk_event_uevent() argument
177 if (events & disk->events & (1 << i)) in disk_event_uevent()
189 unsigned int events; in disk_check_events() local
192 /* check events */ in disk_check_events()
193 events = disk->fops->check_events(disk, clearing); in disk_check_events()
195 /* accumulate pending events and schedule next poll if necessary */ in disk_check_events()
198 events &= ~ev->pending; in disk_check_events()
199 ev->pending |= events; in disk_check_events()
209 if (events & DISK_EVENT_MEDIA_CHANGE) in disk_check_events()
213 disk_event_uevent(disk, events); in disk_check_events()
217 * disk_clear_events - synchronously check, clear and return pending events
218 * @disk: disk to fetch and clear events from
219 * @mask: mask of events to be fetched and cleared
221 * Disk events are synchronously checked and pending events in @mask
241 * can still be modified even if events are blocked). in disk_clear_events()
255 /* then, fetch and clear pending events */ in disk_clear_events()
277 unsigned int events; in bdev_check_media_change() local
279 events = disk_clear_events(bdev->bd_disk, DISK_EVENT_MEDIA_CHANGE | in bdev_check_media_change()
281 if (!(events & DISK_EVENT_MEDIA_CHANGE)) in bdev_check_media_change()
295 * @events: the events to raise
303 bool disk_force_media_change(struct gendisk *disk, unsigned int events) in disk_force_media_change() argument
305 disk_event_uevent(disk, events); in disk_force_media_change()
307 if (!(events & DISK_EVENT_MEDIA_CHANGE)) in disk_force_media_change()
331 * A disk events enabled device has the following sysfs nodes under
334 * events : list of all supported events
335 * events_async : list of events which can be detected w/o polling
339 static ssize_t __disk_events_show(unsigned int events, char *buf) in __disk_events_show() argument
346 if (events & (1 << i)) { in __disk_events_show()
363 return __disk_events_show(disk->events, buf); in disk_events_show()
405 DEVICE_ATTR(events, 0444, disk_events_show, NULL);
451 if (!disk->fops->check_events || !disk->events) in disk_alloc_events()
456 pr_warn("%s: failed to initialize events\n", disk->disk_name); in disk_alloc_events()