fsnotify: use reference counting for groups
authorLino Sanfilippo <LinoSanfilippo@gmx.de>
Tue, 14 Jun 2011 15:29:47 +0000 (17:29 +0200)
committerEric Paris <eparis@redhat.com>
Tue, 11 Dec 2012 18:29:44 +0000 (13:29 -0500)
commit23e964c284ca0a767b80a30482bd53b059d30391
tree43d3cd8c5836a3c43f853366bce51f621773dedc
parent986129520479d689962a42c31acdeaf854ac91f5
fsnotify: use reference counting for groups

Get a group ref for each mark that is added to the groups list and release that
ref when the mark is freed in fsnotify_put_mark().
We also use get a group reference for duplicated marks and for private event
data.
Now we dont free a group any more when the number of marks becomes 0 but when
the groups ref count does. Since this will only happen when all marks are removed
from a groups mark list, we dont have to set the groups number of marks to 1 at
group creation.

Beside clearing all marks in fsnotify_destroy_group() we do also flush the
groups event queue. This is since events may hold references to groups (due to
private event data) and we have to put those references first before we get a
chance to put the final ref, which will result in a call to
fsnotify_final_destroy_group().

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
fs/notify/group.c
fs/notify/inotify/inotify_fsnotify.c
fs/notify/inotify/inotify_user.c
fs/notify/mark.c
This page took 0.025016 seconds and 5 git commands to generate.