diff options
author | Lino Sanfilippo <LinoSanfilippo@gmx.de> | 2011-06-14 19:29:53 +0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2012-12-11 22:44:36 +0400 |
commit | 64c20d2a20fce295c260ea6cb3b468edfa2fb07b (patch) | |
tree | 8b01c3445a90155e4d237a0368d67e81032bb7ea /fs/notify/mark.c | |
parent | d5a335b845792d2a69ed1e244c0b233117b7db3c (diff) | |
download | linux-64c20d2a20fce295c260ea6cb3b468edfa2fb07b.tar.xz |
fsnotify: dont put marks on temporary list when clearing marks by group
In clear_marks_by_group_flags() the mark list of a group is iterated and the
marks are put on a temporary list.
Since we introduced fsnotify_destroy_mark_locked() we dont need the temp list
any more and are able to remove the marks while the mark list is iterated and
the mark list mutex is held.
Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/mark.c')
-rw-r--r-- | fs/notify/mark.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c index f9dda0304a10..0e93d90bb753 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -299,22 +299,16 @@ void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group, unsigned int flags) { struct fsnotify_mark *lmark, *mark; - LIST_HEAD(free_list); mutex_lock(&group->mark_mutex); list_for_each_entry_safe(mark, lmark, &group->marks_list, g_list) { if (mark->flags & flags) { - list_add(&mark->free_g_list, &free_list); - list_del_init(&mark->g_list); fsnotify_get_mark(mark); + fsnotify_destroy_mark_locked(mark, group); + fsnotify_put_mark(mark); } } mutex_unlock(&group->mark_mutex); - - list_for_each_entry_safe(mark, lmark, &free_list, free_g_list) { - fsnotify_destroy_mark(mark, group); - fsnotify_put_mark(mark); - } } /* |