NFS: Clean up nfs_access_zap_cache()
[safe/jmp/linux-2.6] / fs / notify / group.c
index a29d2fa..0e16771 100644 (file)
@@ -91,6 +91,9 @@ static void fsnotify_get_group(struct fsnotify_group *group)
  */
 void fsnotify_final_destroy_group(struct fsnotify_group *group)
 {
+       /* clear the notification queue of all events */
+       fsnotify_flush_notify(group);
+
        if (group->ops->free_group_priv)
                group->ops->free_group_priv(group);
 
@@ -214,6 +217,12 @@ struct fsnotify_group *fsnotify_obtain_group(unsigned int group_num, __u32 mask,
        group->group_num = group_num;
        group->mask = mask;
 
+       mutex_init(&group->notification_mutex);
+       INIT_LIST_HEAD(&group->notification_list);
+       init_waitqueue_head(&group->notification_waitq);
+       group->q_len = 0;
+       group->max_events = UINT_MAX;
+
        spin_lock_init(&group->mark_lock);
        atomic_set(&group->num_marks, 0);
        INIT_LIST_HEAD(&group->mark_entries);