[PATCH 11/14] fsnotify: dont use a free_list to remove marks inclear_marks_by_group_flags()

From: Lino Sanfilippo
Date: Wed Jan 19 2011 - 11:54:21 EST



Dont use a to use a temporary "free_list" in clear_mark_by_group_flags() any more,
since it is now possible to remove a mark while a spinlock is held.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@xxxxxx>
---
fs/notify/mark.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 87d78b9..2827867 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -204,24 +204,16 @@ void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group,
unsigned int flags)
{
struct fsnotify_mark *lmark, *mark;
- LIST_HEAD(free_list);

spin_lock(&group->mark_lock);
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);
- }
+ if (mark->flags & flags)
+ fsnotify_remove_mark_locked(mark);
}
spin_unlock(&group->mark_lock);
-
- list_for_each_entry_safe(mark, lmark, &free_list, free_g_list) {
- fsnotify_destroy_mark(mark);
- fsnotify_put_mark(mark);
- }
}

+
/*
* Given a group, destroy all of the marks associated with that group.
*/
--
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/