Lines Matching defs:event
9 * the event happened. When inotify gets an event it will need to add that
10 * event to the group notify queue. Since a single event might need to be on
11 * multiple group's notification queues we can't add the event directly to each
13 * has a pointer back to the original event. Since the majority of events are
15 * event_holder into each event. This means we have a single allocation instead
51 struct fsnotify_event *event)
54 if (!event || event == group->overflow_event)
57 * If the event is still queued, we have a problem... Do an unreliable
60 * from the list by a different CPU than the one freeing the event.
62 if (!list_empty(&event->list)) {
64 WARN_ON(!list_empty(&event->list));
67 group->ops->free_event(group, event);
71 * Try to add an event to the notification queue.
72 * The group can later pull this event off the queue to deal with.
73 * The group can use the @merge hook to merge the event with a queued event.
74 * The group can use the @insert hook to insert the event into hash table.
76 * 0 if the event was added to a queue
77 * 1 if the event was merged with some other queued event
78 * 2 if the event was not queued - either the queue of events has overflown
82 struct fsnotify_event *event,
91 pr_debug("%s: group=%p event=%p\n", __func__, group, event);
100 if (event == group->overflow_event ||
103 /* Queue overflow event only if it isn't already queued */
108 event = group->overflow_event;
113 ret = merge(group, event);
122 list_add_tail(&event->list, list);
124 insert(group, event);
133 struct fsnotify_event *event)
137 * We need to init list head for the case of overflow event so that
140 list_del_init(&event->list);
145 * Return the first event on the notification list without removing it.
160 * Remove and return the first event from the notification list. It is the
161 * responsibility of the caller to destroy the obtained event
165 struct fsnotify_event *event = fsnotify_peek_first_event(group);
167 if (!event)
170 pr_debug("%s: group=%p event=%p\n", __func__, group, event);
172 fsnotify_remove_queued_event(group, event);
174 return event;
179 * event notifications.
183 struct fsnotify_event *event;
187 event = fsnotify_remove_first_event(group);
189 fsnotify_destroy_event(group, event);