Lines Matching refs:group
35 static void fsnotify_final_destroy_group(struct fsnotify_group *group) in fsnotify_final_destroy_group() argument
37 if (group->ops->free_group_priv) in fsnotify_final_destroy_group()
38 group->ops->free_group_priv(group); in fsnotify_final_destroy_group()
40 mem_cgroup_put(group->memcg); in fsnotify_final_destroy_group()
42 kfree(group); in fsnotify_final_destroy_group()
49 void fsnotify_group_stop_queueing(struct fsnotify_group *group) in fsnotify_group_stop_queueing() argument
51 spin_lock(&group->notification_lock); in fsnotify_group_stop_queueing()
52 group->shutdown = true; in fsnotify_group_stop_queueing()
53 spin_unlock(&group->notification_lock); in fsnotify_group_stop_queueing()
62 void fsnotify_destroy_group(struct fsnotify_group *group) in fsnotify_destroy_group() argument
70 fsnotify_group_stop_queueing(group); in fsnotify_destroy_group()
73 fsnotify_clear_marks_by_group(group, FSNOTIFY_OBJ_ALL_TYPES_MASK); in fsnotify_destroy_group()
80 wait_event(group->notification_waitq, !atomic_read(&group->user_waits)); in fsnotify_destroy_group()
96 fsnotify_flush_notify(group); in fsnotify_destroy_group()
102 if (group->overflow_event) in fsnotify_destroy_group()
103 group->ops->free_event(group->overflow_event); in fsnotify_destroy_group()
105 fsnotify_put_group(group); in fsnotify_destroy_group()
111 void fsnotify_get_group(struct fsnotify_group *group) in fsnotify_get_group() argument
113 refcount_inc(&group->refcnt); in fsnotify_get_group()
119 void fsnotify_put_group(struct fsnotify_group *group) in fsnotify_put_group() argument
121 if (refcount_dec_and_test(&group->refcnt)) in fsnotify_put_group()
122 fsnotify_final_destroy_group(group); in fsnotify_put_group()
130 struct fsnotify_group *group; in fsnotify_alloc_group() local
132 group = kzalloc(sizeof(struct fsnotify_group), GFP_KERNEL); in fsnotify_alloc_group()
133 if (!group) in fsnotify_alloc_group()
137 refcount_set(&group->refcnt, 1); in fsnotify_alloc_group()
138 atomic_set(&group->num_marks, 0); in fsnotify_alloc_group()
139 atomic_set(&group->user_waits, 0); in fsnotify_alloc_group()
141 spin_lock_init(&group->notification_lock); in fsnotify_alloc_group()
142 INIT_LIST_HEAD(&group->notification_list); in fsnotify_alloc_group()
143 init_waitqueue_head(&group->notification_waitq); in fsnotify_alloc_group()
144 group->max_events = UINT_MAX; in fsnotify_alloc_group()
146 mutex_init(&group->mark_mutex); in fsnotify_alloc_group()
147 INIT_LIST_HEAD(&group->marks_list); in fsnotify_alloc_group()
149 group->ops = ops; in fsnotify_alloc_group()
151 return group; in fsnotify_alloc_group()
156 struct fsnotify_group *group = file->private_data; in fsnotify_fasync() local
158 return fasync_helper(fd, file, on, &group->fsn_fa) >= 0 ? 0 : -EIO; in fsnotify_fasync()