aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify/mark.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/notify/mark.c')
-rw-r--r--fs/notify/mark.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index cb1d822f227..1e824e64441 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -270,18 +270,21 @@ err:
270} 270}
271 271
272/* 272/*
273 * Given a group, destroy all of the marks associated with that group. 273 * clear any marks in a group in which mark->flags & flags is true
274 */ 274 */
275void fsnotify_clear_marks_by_group(struct fsnotify_group *group) 275void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group,
276 unsigned int flags)
276{ 277{
277 struct fsnotify_mark *lmark, *mark; 278 struct fsnotify_mark *lmark, *mark;
278 LIST_HEAD(free_list); 279 LIST_HEAD(free_list);
279 280
280 spin_lock(&group->mark_lock); 281 spin_lock(&group->mark_lock);
281 list_for_each_entry_safe(mark, lmark, &group->marks_list, g_list) { 282 list_for_each_entry_safe(mark, lmark, &group->marks_list, g_list) {
282 list_add(&mark->free_g_list, &free_list); 283 if (mark->flags & flags) {
283 list_del_init(&mark->g_list); 284 list_add(&mark->free_g_list, &free_list);
284 fsnotify_get_mark(mark); 285 list_del_init(&mark->g_list);
286 fsnotify_get_mark(mark);
287 }
285 } 288 }
286 spin_unlock(&group->mark_lock); 289 spin_unlock(&group->mark_lock);
287 290
@@ -291,6 +294,14 @@ void fsnotify_clear_marks_by_group(struct fsnotify_group *group)
291 } 294 }
292} 295}
293 296
297/*
298 * Given a group, destroy all of the marks associated with that group.
299 */
300void fsnotify_clear_marks_by_group(struct fsnotify_group *group)
301{
302 fsnotify_clear_marks_by_group_flags(group, (unsigned int)-1);
303}
304
294void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *old) 305void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *old)
295{ 306{
296 assert_spin_locked(&old->lock); 307 assert_spin_locked(&old->lock);