void fsnotify_put_mark(struct fsnotify_mark *mark) { if (atomic_dec_and_test(&mark->refcnt)) { if (mark->group) fsnotify_put_group(mark->group); mark->free_mark(mark); } }
/* * Trying to get rid of a group. Remove all marks, flush all events and release * the group reference. * Note that another thread calling fsnotify_clear_marks_by_group() may still * hold a ref to the group. */ void fsnotify_destroy_group(struct fsnotify_group *group) { /* clear all inode marks for this group */ fsnotify_clear_marks_by_group(group); synchronize_srcu(&fsnotify_mark_srcu); /* clear the notification queue of all events */ fsnotify_flush_notify(group); fsnotify_put_group(group); }
/* * Destroy all marks in the given list. The marks must be already detached from * the original inode / vfsmount. */ void fsnotify_destroy_marks(struct list_head *to_free) { struct fsnotify_mark *mark, *lmark; struct fsnotify_group *group; list_for_each_entry_safe(mark, lmark, to_free, free_list) { spin_lock(&mark->lock); fsnotify_get_group(mark->group); group = mark->group; spin_unlock(&mark->lock); fsnotify_destroy_mark(mark, group); fsnotify_put_mark(mark); fsnotify_put_group(group); }
/* * Trying to get rid of a group. Remove all marks, flush all events and release * the group reference. * Note that another thread calling fsnotify_clear_marks_by_group() may still * hold a ref to the group. */ void fsnotify_destroy_group(struct fsnotify_group *group) { /* clear all inode marks for this group */ fsnotify_clear_marks_by_group(group); synchronize_srcu(&fsnotify_mark_srcu); /* clear the notification queue of all events */ fsnotify_flush_notify(group); /* * Destroy overflow event (we cannot use fsnotify_destroy_event() as * that deliberately ignores overflow events. */ if (group->overflow_event) group->ops->free_event(group->overflow_event); fsnotify_put_group(group); }
static void au_hfsn_fin_br(struct au_branch *br) { if (br->br_hfsn_group) fsnotify_put_group(br->br_hfsn_group); }