• Home
  • Raw
  • Download

Lines Matching refs:group

114 	struct fsnotify_group *group = file->private_data;  in inotify_poll()  local
117 poll_wait(file, &group->notification_waitq, wait); in inotify_poll()
118 spin_lock(&group->notification_lock); in inotify_poll()
119 if (!fsnotify_notify_queue_is_empty(group)) in inotify_poll()
121 spin_unlock(&group->notification_lock); in inotify_poll()
143 static struct fsnotify_event *get_one_event(struct fsnotify_group *group, in get_one_event() argument
149 if (fsnotify_notify_queue_is_empty(group)) in get_one_event()
152 event = fsnotify_peek_first_event(group); in get_one_event()
154 pr_debug("%s: group=%p event=%p\n", __func__, group, event); in get_one_event()
162 fsnotify_remove_first_event(group); in get_one_event()
173 static ssize_t copy_event_to_user(struct fsnotify_group *group, in copy_event_to_user() argument
183 pr_debug("%s: group=%p event=%p\n", __func__, group, fsn_event); in copy_event_to_user()
226 struct fsnotify_group *group; in inotify_read() local
233 group = file->private_data; in inotify_read()
235 add_wait_queue(&group->notification_waitq, &wait); in inotify_read()
237 spin_lock(&group->notification_lock); in inotify_read()
238 kevent = get_one_event(group, count); in inotify_read()
239 spin_unlock(&group->notification_lock); in inotify_read()
241 pr_debug("%s: group=%p kevent=%p\n", __func__, group, kevent); in inotify_read()
247 ret = copy_event_to_user(group, kevent, buf); in inotify_read()
248 fsnotify_destroy_event(group, kevent); in inotify_read()
268 remove_wait_queue(&group->notification_waitq, &wait); in inotify_read()
277 struct fsnotify_group *group = file->private_data; in inotify_release() local
279 pr_debug("%s: group=%p\n", __func__, group); in inotify_release()
282 fsnotify_destroy_group(group); in inotify_release()
290 struct fsnotify_group *group; in inotify_ioctl() local
296 group = file->private_data; in inotify_ioctl()
299 pr_debug("%s: group=%p cmd=%u\n", __func__, group, cmd); in inotify_ioctl()
303 spin_lock(&group->notification_lock); in inotify_ioctl()
304 list_for_each_entry(fsn_event, &group->notification_list, in inotify_ioctl()
309 spin_unlock(&group->notification_lock); in inotify_ioctl()
366 static struct inotify_inode_mark *inotify_idr_find_locked(struct fsnotify_group *group, in inotify_idr_find_locked() argument
369 struct idr *idr = &group->inotify_data.idr; in inotify_idr_find_locked()
370 spinlock_t *idr_lock = &group->inotify_data.idr_lock; in inotify_idr_find_locked()
387 static struct inotify_inode_mark *inotify_idr_find(struct fsnotify_group *group, in inotify_idr_find() argument
391 spinlock_t *idr_lock = &group->inotify_data.idr_lock; in inotify_idr_find()
394 i_mark = inotify_idr_find_locked(group, wd); in inotify_idr_find()
400 static void do_inotify_remove_from_idr(struct fsnotify_group *group, in do_inotify_remove_from_idr() argument
403 struct idr *idr = &group->inotify_data.idr; in do_inotify_remove_from_idr()
404 spinlock_t *idr_lock = &group->inotify_data.idr_lock; in do_inotify_remove_from_idr()
419 static void inotify_remove_from_idr(struct fsnotify_group *group, in inotify_remove_from_idr() argument
422 spinlock_t *idr_lock = &group->inotify_data.idr_lock; in inotify_remove_from_idr()
436 i_mark->fsn_mark.group, i_mark->fsn_mark.inode); in inotify_remove_from_idr()
441 found_i_mark = inotify_idr_find_locked(group, wd); in inotify_remove_from_idr()
445 i_mark->fsn_mark.group, i_mark->fsn_mark.inode); in inotify_remove_from_idr()
458 __func__, i_mark, i_mark->wd, i_mark->fsn_mark.group, in inotify_remove_from_idr()
460 found_i_mark->fsn_mark.group, in inotify_remove_from_idr()
473 i_mark->fsn_mark.group, i_mark->fsn_mark.inode); in inotify_remove_from_idr()
478 do_inotify_remove_from_idr(group, i_mark); in inotify_remove_from_idr()
491 struct fsnotify_group *group) in inotify_ignored_and_remove_idr() argument
496 inotify_handle_event(group, NULL, fsn_mark, NULL, FS_IN_IGNORED, in inotify_ignored_and_remove_idr()
501 inotify_remove_from_idr(group, i_mark); in inotify_ignored_and_remove_idr()
503 atomic_dec(&group->inotify_data.user->inotify_watches); in inotify_ignored_and_remove_idr()
516 static int inotify_update_existing_watch(struct fsnotify_group *group, in inotify_update_existing_watch() argument
529 fsn_mark = fsnotify_find_inode_mark(group, inode); in inotify_update_existing_watch()
567 static int inotify_new_watch(struct fsnotify_group *group, in inotify_new_watch() argument
574 struct idr *idr = &group->inotify_data.idr; in inotify_new_watch()
575 spinlock_t *idr_lock = &group->inotify_data.idr_lock; in inotify_new_watch()
588 if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches) in inotify_new_watch()
596 ret = fsnotify_add_mark_locked(&tmp_i_mark->fsn_mark, group, inode, in inotify_new_watch()
600 inotify_remove_from_idr(group, tmp_i_mark); in inotify_new_watch()
605 atomic_inc(&group->inotify_data.user->inotify_watches); in inotify_new_watch()
617 static int inotify_update_watch(struct fsnotify_group *group, struct inode *inode, u32 arg) in inotify_update_watch() argument
621 mutex_lock(&group->mark_mutex); in inotify_update_watch()
623 ret = inotify_update_existing_watch(group, inode, arg); in inotify_update_watch()
626 ret = inotify_new_watch(group, inode, arg); in inotify_update_watch()
627 mutex_unlock(&group->mark_mutex); in inotify_update_watch()
634 struct fsnotify_group *group; in inotify_new_group() local
637 group = fsnotify_alloc_group(&inotify_fsnotify_ops); in inotify_new_group()
638 if (IS_ERR(group)) in inotify_new_group()
639 return group; in inotify_new_group()
643 fsnotify_destroy_group(group); in inotify_new_group()
646 group->overflow_event = &oevent->fse; in inotify_new_group()
647 fsnotify_init_event(group->overflow_event, NULL, FS_Q_OVERFLOW); in inotify_new_group()
652 group->max_events = max_events; in inotify_new_group()
654 spin_lock_init(&group->inotify_data.idr_lock); in inotify_new_group()
655 idr_init(&group->inotify_data.idr); in inotify_new_group()
656 group->inotify_data.user = get_current_user(); in inotify_new_group()
658 if (atomic_inc_return(&group->inotify_data.user->inotify_devs) > in inotify_new_group()
660 fsnotify_destroy_group(group); in inotify_new_group()
664 return group; in inotify_new_group()
671 struct fsnotify_group *group; in SYSCALL_DEFINE1() local
682 group = inotify_new_group(inotify_max_queued_events); in SYSCALL_DEFINE1()
683 if (IS_ERR(group)) in SYSCALL_DEFINE1()
684 return PTR_ERR(group); in SYSCALL_DEFINE1()
686 ret = anon_inode_getfd("inotify", &inotify_fops, group, in SYSCALL_DEFINE1()
689 fsnotify_destroy_group(group); in SYSCALL_DEFINE1()
702 struct fsnotify_group *group; in SYSCALL_DEFINE3() local
757 group = f.file->private_data; in SYSCALL_DEFINE3()
760 ret = inotify_update_watch(group, inode, mask); in SYSCALL_DEFINE3()
769 struct fsnotify_group *group; in SYSCALL_DEFINE2() local
783 group = f.file->private_data; in SYSCALL_DEFINE2()
786 i_mark = inotify_idr_find(group, wd); in SYSCALL_DEFINE2()
792 fsnotify_destroy_mark(&i_mark->fsn_mark, group); in SYSCALL_DEFINE2()