• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/fs/notify/fanotify/

Lines Matching refs:group

35  * Called with the group->notification_mutex held.
37 static struct fsnotify_event *get_one_event(struct fsnotify_group *group,
40 BUG_ON(!mutex_is_locked(&group->notification_mutex));
42 pr_debug("%s: group=%p count=%zd\n", __func__, group, count);
44 if (fsnotify_notify_queue_is_empty(group))
52 return fsnotify_remove_notify_event(group);
55 static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event)
62 pr_debug("%s: group=%p event=%p\n", __func__, group, event);
84 group->fanotify_data.f_flags | FMODE_NONOTIFY,
105 static ssize_t fill_event_metadata(struct fsnotify_group *group,
109 pr_debug("%s: group=%p metadata=%p event=%p\n", __func__,
110 group, metadata, event);
116 metadata->fd = create_fd(group, event);
122 static struct fanotify_response_event *dequeue_re(struct fsnotify_group *group,
127 mutex_lock(&group->fanotify_data.access_mutex);
128 list_for_each_entry(re, &group->fanotify_data.access_list, list) {
136 mutex_unlock(&group->fanotify_data.access_mutex);
143 static int process_access_response(struct fsnotify_group *group,
150 pr_debug("%s: group=%p fd=%d response=%d\n", __func__, group,
168 re = dequeue_re(group, fd);
174 wake_up(&group->fanotify_data.access_waitq);
181 static int prepare_for_access_response(struct fsnotify_group *group,
197 mutex_lock(&group->fanotify_data.access_mutex);
199 if (group->fanotify_data.bypass_perm) {
200 mutex_unlock(&group->fanotify_data.access_mutex);
206 list_add_tail(&re->list, &group->fanotify_data.access_list);
207 mutex_unlock(&group->fanotify_data.access_mutex);
212 static void remove_access_response(struct fsnotify_group *group,
221 re = dequeue_re(group, fd);
232 static int prepare_for_access_response(struct fsnotify_group *group,
239 static void remove_access_response(struct fsnotify_group *group,
247 static ssize_t copy_event_to_user(struct fsnotify_group *group,
254 pr_debug("%s: group=%p event=%p\n", __func__, group, event);
256 fd = fill_event_metadata(group, &fanotify_event_metadata, event);
260 ret = prepare_for_access_response(group, event, fd);
271 remove_access_response(group, event, fd);
280 struct fsnotify_group *group = file->private_data;
283 poll_wait(file, &group->notification_waitq, wait);
284 mutex_lock(&group->notification_mutex);
285 if (!fsnotify_notify_queue_is_empty(group))
287 mutex_unlock(&group->notification_mutex);
295 struct fsnotify_group *group;
302 group = file->private_data;
304 pr_debug("%s: group=%p\n", __func__, group);
307 prepare_to_wait(&group->notification_waitq, &wait, TASK_INTERRUPTIBLE);
309 mutex_lock(&group->notification_mutex);
310 kevent = get_one_event(group, count);
311 mutex_unlock(&group->notification_mutex);
317 ret = copy_event_to_user(group, kevent, buf);
339 finish_wait(&group->notification_waitq, &wait);
349 struct fsnotify_group *group;
352 group = file->private_data;
357 pr_debug("%s: group=%p count=%zu\n", __func__, group, count);
362 ret = process_access_response(group, &response);
374 struct fsnotify_group *group = file->private_data;
377 pr_debug("%s: file=%p group=%p\n", __func__, file, group);
380 mutex_lock(&group->fanotify_data.access_mutex);
382 group->fanotify_data.bypass_perm = true;
384 list_for_each_entry_safe(re, lre, &group->fanotify_data.access_list, list) {
385 pr_debug("%s: found group=%p re=%p event=%p\n", __func__, group,
393 mutex_unlock(&group->fanotify_data.access_mutex);
395 wake_up(&group->fanotify_data.access_waitq);
398 fsnotify_put_group(group);
405 struct fsnotify_group *group;
411 group = file->private_data;
417 mutex_lock(&group->notification_mutex);
418 list_for_each_entry(holder, &group->notification_list, event_list)
420 mutex_unlock(&group->notification_mutex);
513 static int fanotify_remove_vfsmount_mark(struct fsnotify_group *group,
520 fsn_mark = fsnotify_find_vfsmount_mark(group, mnt);
532 static int fanotify_remove_inode_mark(struct fsnotify_group *group,
539 fsn_mark = fsnotify_find_inode_mark(group, inode);
573 static int fanotify_add_vfsmount_mark(struct fsnotify_group *group,
580 fsn_mark = fsnotify_find_vfsmount_mark(group, mnt);
589 ret = fsnotify_add_mark(fsn_mark, group, NULL, mnt, 0);
603 static int fanotify_add_inode_mark(struct fsnotify_group *group,
610 pr_debug("%s: group=%p inode=%p\n", __func__, group, inode);
612 fsn_mark = fsnotify_find_inode_mark(group, inode);
621 ret = fsnotify_add_mark(fsn_mark, group, inode, NULL, 0);
637 struct fsnotify_group *group;
656 group = fsnotify_alloc_group(&fanotify_fsnotify_ops);
657 if (IS_ERR(group))
658 return PTR_ERR(group);
660 group->fanotify_data.f_flags = event_f_flags;
662 mutex_init(&group->fanotify_data.access_mutex);
663 init_waitqueue_head(&group->fanotify_data.access_waitq);
664 INIT_LIST_HEAD(&group->fanotify_data.access_list);
667 fd = anon_inode_getfd("[fanotify]", &fanotify_fops, group, f_flags);
674 fsnotify_put_group(group);
684 struct fsnotify_group *group;
726 /* inode held in place by reference to path; group by fget on fd */
731 group = filp->private_data;
737 ret = fanotify_add_vfsmount_mark(group, mnt, mask, flags);
739 ret = fanotify_add_inode_mark(group, inode, mask, flags);
743 ret = fanotify_remove_vfsmount_mark(group, mnt, mask, flags);
745 ret = fanotify_remove_inode_mark(group, inode, mask, flags);
749 fsnotify_clear_vfsmount_marks_by_group(group);
751 fsnotify_clear_inode_marks_by_group(group);