Lines Matching defs:group

7  * Basic idea behind the notification queue: An fsnotify group (like inotify)
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
17 * another group a new event_holder (from fsnotify_event_holder_cachep) will be
50 void fsnotify_destroy_event(struct fsnotify_group *group,
53 /* Overflow events are per-group and we don't want to free them */
54 if (!event || event == group->overflow_event)
63 spin_lock(&group->notification_lock);
65 spin_unlock(&group->notification_lock);
67 group->ops->free_event(group, event);
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.
79 * or the group is shutting down.
81 int fsnotify_insert_event(struct fsnotify_group *group,
89 struct list_head *list = &group->notification_list;
91 pr_debug("%s: group=%p event=%p\n", __func__, group, event);
93 spin_lock(&group->notification_lock);
95 if (group->shutdown) {
96 spin_unlock(&group->notification_lock);
100 if (event == group->overflow_event ||
101 group->q_len >= group->max_events) {
104 if (!list_empty(&group->overflow_event->list)) {
105 spin_unlock(&group->notification_lock);
108 event = group->overflow_event;
113 ret = merge(group, event);
115 spin_unlock(&group->notification_lock);
121 group->q_len++;
124 insert(group, event);
125 spin_unlock(&group->notification_lock);
127 wake_up(&group->notification_waitq);
128 kill_fasync(&group->fsn_fa, SIGIO, POLL_IN);
132 void fsnotify_remove_queued_event(struct fsnotify_group *group,
135 assert_spin_locked(&group->notification_lock);
141 group->q_len--;
148 struct fsnotify_event *fsnotify_peek_first_event(struct fsnotify_group *group)
150 assert_spin_locked(&group->notification_lock);
152 if (fsnotify_notify_queue_is_empty(group))
155 return list_first_entry(&group->notification_list,
163 struct fsnotify_event *fsnotify_remove_first_event(struct fsnotify_group *group)
165 struct fsnotify_event *event = fsnotify_peek_first_event(group);
170 pr_debug("%s: group=%p event=%p\n", __func__, group, event);
172 fsnotify_remove_queued_event(group, event);
178 * Called when a group is being torn down to clean up any outstanding
181 void fsnotify_flush_notify(struct fsnotify_group *group)
185 spin_lock(&group->notification_lock);
186 while (!fsnotify_notify_queue_is_empty(group)) {
187 event = fsnotify_remove_first_event(group);
188 spin_unlock(&group->notification_lock);
189 fsnotify_destroy_event(group, event);
190 spin_lock(&group->notification_lock);
192 spin_unlock(&group->notification_lock);