aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify/group.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/notify/group.c')
-rw-r--r--fs/notify/group.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/notify/group.c b/fs/notify/group.c
index 934860e98095..1d20d26d5fee 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -162,16 +162,13 @@ void fsnotify_put_group(struct fsnotify_group *group)
162} 162}
163 163
164/* 164/*
165 * Either finds an existing group which matches the group_num, mask, and ops or 165 * Create a new fsnotify_group and hold a reference for the group returned.
166 * creates a new group and adds it to the global group list. In either case we
167 * take a reference for the group returned.
168 */ 166 */
169struct fsnotify_group *fsnotify_obtain_group(__u32 mask, 167struct fsnotify_group *fsnotify_alloc_group(__u32 mask,
170 const struct fsnotify_ops *ops) 168 const struct fsnotify_ops *ops)
171{ 169{
172 struct fsnotify_group *group; 170 struct fsnotify_group *group;
173 171
174 /* very low use, simpler locking if we just always alloc */
175 group = kzalloc(sizeof(struct fsnotify_group), GFP_KERNEL); 172 group = kzalloc(sizeof(struct fsnotify_group), GFP_KERNEL);
176 if (!group) 173 if (!group)
177 return ERR_PTR(-ENOMEM); 174 return ERR_PTR(-ENOMEM);
@@ -192,7 +189,6 @@ struct fsnotify_group *fsnotify_obtain_group(__u32 mask,
192 189
193 mutex_lock(&fsnotify_grp_mutex); 190 mutex_lock(&fsnotify_grp_mutex);
194 191
195 /* group not found, add a new one */
196 list_add_rcu(&group->group_list, &fsnotify_groups); 192 list_add_rcu(&group->group_list, &fsnotify_groups);
197 group->on_group_list = 1; 193 group->on_group_list = 1;
198 /* being on the fsnotify_groups list holds one num_marks */ 194 /* being on the fsnotify_groups list holds one num_marks */