Lines Matching refs:group
64 bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group) in fsnotify_notify_queue_is_empty() argument
66 BUG_ON(!mutex_is_locked(&group->notification_mutex)); 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
78 group->ops->free_event(event); in fsnotify_destroy_event()
87 int fsnotify_add_event(struct fsnotify_group *group, in fsnotify_add_event() argument
93 struct list_head *list = &group->notification_list; in fsnotify_add_event()
95 pr_debug("%s: group=%p event=%p\n", __func__, group, event); in fsnotify_add_event()
97 mutex_lock(&group->notification_mutex); in fsnotify_add_event()
99 if (group->q_len >= group->max_events) { in fsnotify_add_event()
102 if (!list_empty(&group->overflow_event->list)) { in fsnotify_add_event()
103 mutex_unlock(&group->notification_mutex); in fsnotify_add_event()
106 event = group->overflow_event; in fsnotify_add_event()
113 mutex_unlock(&group->notification_mutex); in fsnotify_add_event()
119 group->q_len++; in fsnotify_add_event()
121 mutex_unlock(&group->notification_mutex); in fsnotify_add_event()
123 wake_up(&group->notification_waitq); in fsnotify_add_event()
124 kill_fasync(&group->fsn_fa, SIGIO, POLL_IN); in fsnotify_add_event()
132 void fsnotify_remove_event(struct fsnotify_group *group, in fsnotify_remove_event() argument
135 mutex_lock(&group->notification_mutex); in fsnotify_remove_event()
138 group->q_len--; in fsnotify_remove_event()
140 mutex_unlock(&group->notification_mutex); in fsnotify_remove_event()
147 struct fsnotify_event *fsnotify_remove_first_event(struct fsnotify_group *group) in fsnotify_remove_first_event() argument
151 BUG_ON(!mutex_is_locked(&group->notification_mutex)); in fsnotify_remove_first_event()
153 pr_debug("%s: group=%p\n", __func__, group); in fsnotify_remove_first_event()
155 event = list_first_entry(&group->notification_list, in fsnotify_remove_first_event()
162 group->q_len--; in fsnotify_remove_first_event()
171 struct fsnotify_event *fsnotify_peek_first_event(struct fsnotify_group *group) in fsnotify_peek_first_event() argument
173 BUG_ON(!mutex_is_locked(&group->notification_mutex)); in fsnotify_peek_first_event()
175 return list_first_entry(&group->notification_list, in fsnotify_peek_first_event()
183 void fsnotify_flush_notify(struct fsnotify_group *group) in fsnotify_flush_notify() argument
187 mutex_lock(&group->notification_mutex); in fsnotify_flush_notify()
188 while (!fsnotify_notify_queue_is_empty(group)) { in fsnotify_flush_notify()
189 event = fsnotify_remove_first_event(group); in fsnotify_flush_notify()
190 fsnotify_destroy_event(group, event); in fsnotify_flush_notify()
192 mutex_unlock(&group->notification_mutex); in fsnotify_flush_notify()