Lines Matching refs:group

141 	struct fsnotify_group *group = file->private_data;  in inotify_poll()  local
144 poll_wait(file, &group->notification_waitq, wait); in inotify_poll()
145 spin_lock(&group->notification_lock); in inotify_poll()
146 if (!fsnotify_notify_queue_is_empty(group)) in inotify_poll()
148 spin_unlock(&group->notification_lock); in inotify_poll()
170 static struct fsnotify_event *get_one_event(struct fsnotify_group *group, in get_one_event() argument
176 event = fsnotify_peek_first_event(group); in get_one_event()
180 pr_debug("%s: group=%p event=%p\n", __func__, group, event); in get_one_event()
188 fsnotify_remove_first_event(group); in get_one_event()
199 static ssize_t copy_event_to_user(struct fsnotify_group *group, in copy_event_to_user() argument
209 pr_debug("%s: group=%p event=%p\n", __func__, group, fsn_event); in copy_event_to_user()
252 struct fsnotify_group *group; in inotify_read() local
259 group = file->private_data; in inotify_read()
261 add_wait_queue(&group->notification_waitq, &wait); in inotify_read()
263 spin_lock(&group->notification_lock); in inotify_read()
264 kevent = get_one_event(group, count); in inotify_read()
265 spin_unlock(&group->notification_lock); in inotify_read()
267 pr_debug("%s: group=%p kevent=%p\n", __func__, group, kevent); in inotify_read()
273 ret = copy_event_to_user(group, kevent, buf); in inotify_read()
274 fsnotify_destroy_event(group, kevent); in inotify_read()
294 remove_wait_queue(&group->notification_waitq, &wait); in inotify_read()
303 struct fsnotify_group *group = file->private_data; in inotify_release() local
305 pr_debug("%s: group=%p\n", __func__, group); in inotify_release()
308 fsnotify_destroy_group(group); in inotify_release()
316 struct fsnotify_group *group; in inotify_ioctl() local
322 group = file->private_data; in inotify_ioctl()
325 pr_debug("%s: group=%p cmd=%u\n", __func__, group, cmd); in inotify_ioctl()
329 spin_lock(&group->notification_lock); in inotify_ioctl()
330 list_for_each_entry(fsn_event, &group->notification_list, in inotify_ioctl()
335 spin_unlock(&group->notification_lock); in inotify_ioctl()
344 data = &group->inotify_data; in inotify_ioctl()
414 static struct inotify_inode_mark *inotify_idr_find_locked(struct fsnotify_group *group, in inotify_idr_find_locked() argument
417 struct idr *idr = &group->inotify_data.idr; in inotify_idr_find_locked()
418 spinlock_t *idr_lock = &group->inotify_data.idr_lock; in inotify_idr_find_locked()
435 static struct inotify_inode_mark *inotify_idr_find(struct fsnotify_group *group, in inotify_idr_find() argument
439 spinlock_t *idr_lock = &group->inotify_data.idr_lock; in inotify_idr_find()
442 i_mark = inotify_idr_find_locked(group, wd); in inotify_idr_find()
452 static void inotify_remove_from_idr(struct fsnotify_group *group, in inotify_remove_from_idr() argument
455 struct idr *idr = &group->inotify_data.idr; in inotify_remove_from_idr()
456 spinlock_t *idr_lock = &group->inotify_data.idr_lock; in inotify_remove_from_idr()
469 __func__, i_mark, i_mark->wd, i_mark->fsn_mark.group); in inotify_remove_from_idr()
474 found_i_mark = inotify_idr_find_locked(group, wd); in inotify_remove_from_idr()
477 __func__, i_mark, i_mark->wd, i_mark->fsn_mark.group); in inotify_remove_from_idr()
490 i_mark->wd, i_mark->fsn_mark.group, found_i_mark, in inotify_remove_from_idr()
491 found_i_mark->wd, found_i_mark->fsn_mark.group); in inotify_remove_from_idr()
501 __func__, i_mark, i_mark->wd, i_mark->fsn_mark.group); in inotify_remove_from_idr()
521 struct fsnotify_group *group) in inotify_ignored_and_remove_idr() argument
531 inotify_remove_from_idr(group, i_mark); in inotify_ignored_and_remove_idr()
533 dec_inotify_watches(group->inotify_data.ucounts); in inotify_ignored_and_remove_idr()
536 static int inotify_update_existing_watch(struct fsnotify_group *group, in inotify_update_existing_watch() argument
547 fsn_mark = fsnotify_find_inode_mark(inode, group); in inotify_update_existing_watch()
590 static int inotify_new_watch(struct fsnotify_group *group, in inotify_new_watch() argument
596 struct idr *idr = &group->inotify_data.idr; in inotify_new_watch()
597 spinlock_t *idr_lock = &group->inotify_data.idr_lock; in inotify_new_watch()
603 fsnotify_init_mark(&tmp_i_mark->fsn_mark, group); in inotify_new_watch()
613 if (!inc_inotify_watches(group->inotify_data.ucounts)) { in inotify_new_watch()
614 inotify_remove_from_idr(group, tmp_i_mark); in inotify_new_watch()
623 inotify_remove_from_idr(group, tmp_i_mark); in inotify_new_watch()
638 static int inotify_update_watch(struct fsnotify_group *group, struct inode *inode, u32 arg) in inotify_update_watch() argument
642 fsnotify_group_lock(group); in inotify_update_watch()
644 ret = inotify_update_existing_watch(group, inode, arg); in inotify_update_watch()
647 ret = inotify_new_watch(group, inode, arg); in inotify_update_watch()
648 fsnotify_group_unlock(group); in inotify_update_watch()
655 struct fsnotify_group *group; in inotify_new_group() local
658 group = fsnotify_alloc_group(&inotify_fsnotify_ops, in inotify_new_group()
660 if (IS_ERR(group)) in inotify_new_group()
661 return group; in inotify_new_group()
665 fsnotify_destroy_group(group); in inotify_new_group()
668 group->overflow_event = &oevent->fse; in inotify_new_group()
669 fsnotify_init_event(group->overflow_event); in inotify_new_group()
675 group->max_events = max_events; in inotify_new_group()
676 group->memcg = get_mem_cgroup_from_mm(current->mm); in inotify_new_group()
678 spin_lock_init(&group->inotify_data.idr_lock); in inotify_new_group()
679 idr_init(&group->inotify_data.idr); in inotify_new_group()
680 group->inotify_data.ucounts = inc_ucount(current_user_ns(), in inotify_new_group()
684 if (!group->inotify_data.ucounts) { in inotify_new_group()
685 fsnotify_destroy_group(group); in inotify_new_group()
689 return group; in inotify_new_group()
696 struct fsnotify_group *group; in do_inotify_init() local
707 group = inotify_new_group(inotify_max_queued_events); in do_inotify_init()
708 if (IS_ERR(group)) in do_inotify_init()
709 return PTR_ERR(group); in do_inotify_init()
711 ret = anon_inode_getfd("inotify", &inotify_fops, group, in do_inotify_init()
714 fsnotify_destroy_group(group); in do_inotify_init()
732 struct fsnotify_group *group; in SYSCALL_DEFINE3() local
783 group = fd_file(f)->private_data; in SYSCALL_DEFINE3()
786 ret = inotify_update_watch(group, inode, mask); in SYSCALL_DEFINE3()
795 struct fsnotify_group *group; in SYSCALL_DEFINE2() local
808 group = fd_file(f)->private_data; in SYSCALL_DEFINE2()
810 i_mark = inotify_idr_find(group, wd); in SYSCALL_DEFINE2()
816 fsnotify_destroy_mark(&i_mark->fsn_mark, group); in SYSCALL_DEFINE2()