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