Lines Matching refs:group

22 static void fsnotify_final_destroy_group(struct fsnotify_group *group)  in fsnotify_final_destroy_group()  argument
24 if (group->ops->free_group_priv) in fsnotify_final_destroy_group()
25 group->ops->free_group_priv(group); in fsnotify_final_destroy_group()
27 mem_cgroup_put(group->memcg); in fsnotify_final_destroy_group()
28 mutex_destroy(&group->mark_mutex); in fsnotify_final_destroy_group()
30 kfree(group); in fsnotify_final_destroy_group()
37 void fsnotify_group_stop_queueing(struct fsnotify_group *group) in fsnotify_group_stop_queueing() argument
39 spin_lock(&group->notification_lock); in fsnotify_group_stop_queueing()
40 group->shutdown = true; in fsnotify_group_stop_queueing()
41 spin_unlock(&group->notification_lock); in fsnotify_group_stop_queueing()
50 void fsnotify_destroy_group(struct fsnotify_group *group) in fsnotify_destroy_group() argument
58 fsnotify_group_stop_queueing(group); in fsnotify_destroy_group()
61 fsnotify_clear_marks_by_group(group, FSNOTIFY_OBJ_TYPE_ANY); in fsnotify_destroy_group()
68 wait_event(group->notification_waitq, !atomic_read(&group->user_waits)); in fsnotify_destroy_group()
84 fsnotify_flush_notify(group); in fsnotify_destroy_group()
90 if (group->overflow_event) in fsnotify_destroy_group()
91 group->ops->free_event(group, group->overflow_event); in fsnotify_destroy_group()
93 fsnotify_put_group(group); in fsnotify_destroy_group()
99 void fsnotify_get_group(struct fsnotify_group *group) in fsnotify_get_group() argument
101 refcount_inc(&group->refcnt); in fsnotify_get_group()
107 void fsnotify_put_group(struct fsnotify_group *group) in fsnotify_put_group() argument
109 if (refcount_dec_and_test(&group->refcnt)) in fsnotify_put_group()
110 fsnotify_final_destroy_group(group); in fsnotify_put_group()
119 struct fsnotify_group *group; in __fsnotify_alloc_group() local
121 group = kzalloc(sizeof(struct fsnotify_group), gfp); in __fsnotify_alloc_group()
122 if (!group) in __fsnotify_alloc_group()
126 refcount_set(&group->refcnt, 1); in __fsnotify_alloc_group()
127 atomic_set(&group->user_waits, 0); in __fsnotify_alloc_group()
129 spin_lock_init(&group->notification_lock); in __fsnotify_alloc_group()
130 INIT_LIST_HEAD(&group->notification_list); in __fsnotify_alloc_group()
131 init_waitqueue_head(&group->notification_waitq); in __fsnotify_alloc_group()
132 group->max_events = UINT_MAX; in __fsnotify_alloc_group()
134 mutex_init(&group->mark_mutex); in __fsnotify_alloc_group()
135 INIT_LIST_HEAD(&group->marks_list); in __fsnotify_alloc_group()
137 group->ops = ops; in __fsnotify_alloc_group()
138 group->flags = flags; in __fsnotify_alloc_group()
148 lockdep_set_class(&group->mark_mutex, &nofs_marks_lock); in __fsnotify_alloc_group()
150 return group; in __fsnotify_alloc_group()
168 struct fsnotify_group *group = file->private_data; in fsnotify_fasync() local
170 return fasync_helper(fd, file, on, &group->fsn_fa) >= 0 ? 0 : -EIO; in fsnotify_fasync()