Lines Matching refs:group
142 struct fsnotify_group *group = file->private_data;
145 poll_wait(file, &group->notification_waitq, wait);
146 spin_lock(&group->notification_lock);
147 if (!fsnotify_notify_queue_is_empty(group))
149 spin_unlock(&group->notification_lock);
169 * Called with the group->notification_lock held.
171 static struct fsnotify_event *get_one_event(struct fsnotify_group *group,
177 event = fsnotify_peek_first_event(group);
181 pr_debug("%s: group=%p event=%p\n", __func__, group, event);
189 fsnotify_remove_first_event(group);
200 static ssize_t copy_event_to_user(struct fsnotify_group *group,
210 pr_debug("%s: group=%p event=%p\n", __func__, group, fsn_event);
253 struct fsnotify_group *group;
260 group = file->private_data;
262 add_wait_queue(&group->notification_waitq, &wait);
264 spin_lock(&group->notification_lock);
265 kevent = get_one_event(group, count);
266 spin_unlock(&group->notification_lock);
268 pr_debug("%s: group=%p kevent=%p\n", __func__, group, kevent);
274 ret = copy_event_to_user(group, kevent, buf);
275 fsnotify_destroy_event(group, kevent);
295 remove_wait_queue(&group->notification_waitq, &wait);
304 struct fsnotify_group *group = file->private_data;
306 pr_debug("%s: group=%p\n", __func__, group);
308 /* free this group, matching get was inotify_init->fsnotify_obtain_group */
309 fsnotify_destroy_group(group);
317 struct fsnotify_group *group;
323 group = file->private_data;
326 pr_debug("%s: group=%p cmd=%u\n", __func__, group, cmd);
330 spin_lock(&group->notification_lock);
331 list_for_each_entry(fsn_event, &group->notification_list,
336 spin_unlock(&group->notification_lock);
345 data = &group->inotify_data;
415 static struct inotify_inode_mark *inotify_idr_find_locked(struct fsnotify_group *group,
418 struct idr *idr = &group->inotify_data.idr;
419 spinlock_t *idr_lock = &group->inotify_data.idr_lock;
436 static struct inotify_inode_mark *inotify_idr_find(struct fsnotify_group *group,
440 spinlock_t *idr_lock = &group->inotify_data.idr_lock;
443 i_mark = inotify_idr_find_locked(group, wd);
453 static void inotify_remove_from_idr(struct fsnotify_group *group,
456 struct idr *idr = &group->inotify_data.idr;
457 spinlock_t *idr_lock = &group->inotify_data.idr_lock;
469 WARN_ONCE(1, "%s: i_mark=%p i_mark->wd=%d i_mark->group=%p\n",
470 __func__, i_mark, i_mark->wd, i_mark->fsn_mark.group);
475 found_i_mark = inotify_idr_find_locked(group, wd);
477 WARN_ONCE(1, "%s: i_mark=%p i_mark->wd=%d i_mark->group=%p\n",
478 __func__, i_mark, i_mark->wd, i_mark->fsn_mark.group);
488 WARN_ONCE(1, "%s: i_mark=%p i_mark->wd=%d i_mark->group=%p "
490 "found_i_mark->group=%p\n", __func__, i_mark,
491 i_mark->wd, i_mark->fsn_mark.group, found_i_mark,
492 found_i_mark->wd, found_i_mark->fsn_mark.group);
501 printk(KERN_ERR "%s: i_mark=%p i_mark->wd=%d i_mark->group=%p\n",
502 __func__, i_mark, i_mark->wd, i_mark->fsn_mark.group);
522 struct fsnotify_group *group)
532 inotify_remove_from_idr(group, i_mark);
534 dec_inotify_watches(group->inotify_data.ucounts);
537 static int inotify_update_existing_watch(struct fsnotify_group *group,
548 fsn_mark = fsnotify_find_mark(&inode->i_fsnotify_marks, group);
591 static int inotify_new_watch(struct fsnotify_group *group,
597 struct idr *idr = &group->inotify_data.idr;
598 spinlock_t *idr_lock = &group->inotify_data.idr_lock;
604 fsnotify_init_mark(&tmp_i_mark->fsn_mark, group);
614 if (!inc_inotify_watches(group->inotify_data.ucounts)) {
615 inotify_remove_from_idr(group, tmp_i_mark);
624 inotify_remove_from_idr(group, tmp_i_mark);
639 static int inotify_update_watch(struct fsnotify_group *group, struct inode *inode, u32 arg)
643 fsnotify_group_lock(group);
645 ret = inotify_update_existing_watch(group, inode, arg);
648 ret = inotify_new_watch(group, inode, arg);
649 fsnotify_group_unlock(group);
656 struct fsnotify_group *group;
659 group = fsnotify_alloc_group(&inotify_fsnotify_ops,
661 if (IS_ERR(group))
662 return group;
666 fsnotify_destroy_group(group);
669 group->overflow_event = &oevent->fse;
670 fsnotify_init_event(group->overflow_event);
676 group->max_events = max_events;
677 group->memcg = get_mem_cgroup_from_mm(current->mm);
679 spin_lock_init(&group->inotify_data.idr_lock);
680 idr_init(&group->inotify_data.idr);
681 group->inotify_data.ucounts = inc_ucount(current_user_ns(),
685 if (!group->inotify_data.ucounts) {
686 fsnotify_destroy_group(group);
690 return group;
697 struct fsnotify_group *group;
707 /* fsnotify_obtain_group took a reference to group, we put this when we kill the file in the end */
708 group = inotify_new_group(inotify_max_queued_events);
709 if (IS_ERR(group))
710 return PTR_ERR(group);
712 ret = anon_inode_getfd("inotify", &inotify_fops, group,
715 fsnotify_destroy_group(group);
733 struct fsnotify_group *group;
782 /* inode held in place by reference to path; group by fget on fd */
784 group = f.file->private_data;
787 ret = inotify_update_watch(group, inode, mask);
796 struct fsnotify_group *group;
809 group = f.file->private_data;
811 i_mark = inotify_idr_find(group, wd);
817 fsnotify_destroy_mark(&i_mark->fsn_mark, group);