aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify/group.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/notify/group.c')
-rw-r--r--fs/notify/group.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/notify/group.c b/fs/notify/group.c
index a29d2fa67927..0e1677144bc5 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -91,6 +91,9 @@ static void fsnotify_get_group(struct fsnotify_group *group)
91 */ 91 */
92void fsnotify_final_destroy_group(struct fsnotify_group *group) 92void fsnotify_final_destroy_group(struct fsnotify_group *group)
93{ 93{
94 /* clear the notification queue of all events */
95 fsnotify_flush_notify(group);
96
94 if (group->ops->free_group_priv) 97 if (group->ops->free_group_priv)
95 group->ops->free_group_priv(group); 98 group->ops->free_group_priv(group);
96 99
@@ -214,6 +217,12 @@ struct fsnotify_group *fsnotify_obtain_group(unsigned int group_num, __u32 mask,
214 group->group_num = group_num; 217 group->group_num = group_num;
215 group->mask = mask; 218 group->mask = mask;
216 219
220 mutex_init(&group->notification_mutex);
221 INIT_LIST_HEAD(&group->notification_list);
222 init_waitqueue_head(&group->notification_waitq);
223 group->q_len = 0;
224 group->max_events = UINT_MAX;
225
217 spin_lock_init(&group->mark_lock); 226 spin_lock_init(&group->mark_lock);
218 atomic_set(&group->num_marks, 0); 227 atomic_set(&group->num_marks, 0);
219 INIT_LIST_HEAD(&group->mark_entries); 228 INIT_LIST_HEAD(&group->mark_entries);