• Home
  • Raw
  • Download

Lines Matching full:group

20  * Basic idea behind the notification queue: An fsnotify group (like inotify)
23 * event to the group notify queue. Since a single event might need to be on
24 * multiple group's notification queues we can't add the event directly to each
30 * another group a new event_holder (from fsnotify_event_holder_cachep) will be
64 bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group) in fsnotify_notify_queue_is_empty() argument
66 assert_spin_locked(&group->notification_lock); in fsnotify_notify_queue_is_empty()
67 return list_empty(&group->notification_list) ? true : false; in fsnotify_notify_queue_is_empty()
70 void fsnotify_destroy_event(struct fsnotify_group *group, in fsnotify_destroy_event() argument
73 /* Overflow events are per-group and we don't want to free them */ in fsnotify_destroy_event()
83 spin_lock(&group->notification_lock); in fsnotify_destroy_event()
85 spin_unlock(&group->notification_lock); in fsnotify_destroy_event()
87 group->ops->free_event(event); in fsnotify_destroy_event()
91 * Add an event to the group notification queue. The group can later pull this
95 * or the group is shutting down.
97 int fsnotify_add_event(struct fsnotify_group *group, in fsnotify_add_event() argument
103 struct list_head *list = &group->notification_list; in fsnotify_add_event()
105 pr_debug("%s: group=%p event=%p\n", __func__, group, event); in fsnotify_add_event()
107 spin_lock(&group->notification_lock); in fsnotify_add_event()
109 if (group->shutdown) { in fsnotify_add_event()
110 spin_unlock(&group->notification_lock); in fsnotify_add_event()
114 if (event == group->overflow_event || in fsnotify_add_event()
115 group->q_len >= group->max_events) { in fsnotify_add_event()
118 if (!list_empty(&group->overflow_event->list)) { in fsnotify_add_event()
119 spin_unlock(&group->notification_lock); in fsnotify_add_event()
122 event = group->overflow_event; in fsnotify_add_event()
129 spin_unlock(&group->notification_lock); in fsnotify_add_event()
135 group->q_len++; in fsnotify_add_event()
137 spin_unlock(&group->notification_lock); in fsnotify_add_event()
139 wake_up(&group->notification_waitq); in fsnotify_add_event()
140 kill_fasync(&group->fsn_fa, SIGIO, POLL_IN); in fsnotify_add_event()
148 struct fsnotify_event *fsnotify_remove_first_event(struct fsnotify_group *group) in fsnotify_remove_first_event() argument
152 assert_spin_locked(&group->notification_lock); in fsnotify_remove_first_event()
154 pr_debug("%s: group=%p\n", __func__, group); in fsnotify_remove_first_event()
156 event = list_first_entry(&group->notification_list, in fsnotify_remove_first_event()
163 group->q_len--; in fsnotify_remove_first_event()
172 struct fsnotify_event *fsnotify_peek_first_event(struct fsnotify_group *group) in fsnotify_peek_first_event() argument
174 assert_spin_locked(&group->notification_lock); in fsnotify_peek_first_event()
176 return list_first_entry(&group->notification_list, in fsnotify_peek_first_event()
181 * Called when a group is being torn down to clean up any outstanding
184 void fsnotify_flush_notify(struct fsnotify_group *group) in fsnotify_flush_notify() argument
188 spin_lock(&group->notification_lock); in fsnotify_flush_notify()
189 while (!fsnotify_notify_queue_is_empty(group)) { in fsnotify_flush_notify()
190 event = fsnotify_remove_first_event(group); in fsnotify_flush_notify()
191 spin_unlock(&group->notification_lock); in fsnotify_flush_notify()
192 fsnotify_destroy_event(group, event); in fsnotify_flush_notify()
193 spin_lock(&group->notification_lock); in fsnotify_flush_notify()
195 spin_unlock(&group->notification_lock); in fsnotify_flush_notify()
200 * group's handle_event function if the group was interested in this