From 80e003a3fdea1893788f6d52bec8605e15b3acb6 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Thu, 17 Dec 2009 21:24:23 -0500 Subject: [PATCH] --- yaml --- r: 207635 b: refs/heads/master c: 36fddebaa8a9186d4f5817ab798a83400b2fb2e7 h: refs/heads/master i: 207633: 8ea83b4e6c87fa6922c3148f46e04c08ac6cec36 207631: efc58a65095cab0a3b7606544f6a08bce55b168d v: v3 --- [refs] | 2 +- trunk/fs/notify/group.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 2c5aea249168..b0f6f7538a2f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 19c2a0e1a2f60112c158342ba5f568f72b741c2c +refs/heads/master: 36fddebaa8a9186d4f5817ab798a83400b2fb2e7 diff --git a/trunk/fs/notify/group.c b/trunk/fs/notify/group.c index c80809745312..656c534ffb66 100644 --- a/trunk/fs/notify/group.c +++ b/trunk/fs/notify/group.c @@ -82,9 +82,6 @@ static void fsnotify_add_group(struct fsnotify_group *group) BUG_ON(!mutex_is_locked(&fsnotify_grp_mutex)); group->on_inode_group_list = 1; - /* being on the fsnotify_groups list holds one num_marks */ - atomic_inc(&group->num_marks); - list_add_tail_rcu(&group->inode_group_list, &fsnotify_inode_groups); } @@ -183,7 +180,14 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) if (!group) return ERR_PTR(-ENOMEM); + /* set to 0 when there a no external references to this group */ atomic_set(&group->refcnt, 1); + /* + * hits 0 when there are no external references AND no marks for + * this group + */ + atomic_set(&group->num_marks, 1); + mutex_init(&group->notification_mutex); INIT_LIST_HEAD(&group->notification_list);