Loading fs/notify/fsnotify.c +4 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,10 @@ static int send_to_group(struct fsnotify_group *group, struct inode *to_tell, int data_is, u32 cookie, const unsigned char *file_name, struct fsnotify_event **event) { pr_debug("%s: group=%p to_tell=%p mnt=%p mask=%x data=%p data_is=%d" " cookie=%d event=%p\n", __func__, group, to_tell, mnt, mask, data, data_is, cookie, *event); if (!group->ops->should_send_event(group, to_tell, mnt, mask, data, data_is)) return 0; Loading fs/notify/inotify/inotify_fsnotify.c +6 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev struct fsnotify_event_private_data *fsn_event_priv; int wd, ret; pr_debug("%s: group=%p event=%p to_tell=%p mask=%x\n", __func__, group, event, event->to_tell, event->mask); to_tell = event->to_tell; fsn_mark = fsnotify_find_inode_mark(group, to_tell); Loading Loading @@ -151,6 +154,9 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode struct fsnotify_mark *fsn_mark; bool send; pr_debug("%s: group=%p inode=%p mask=%x data=%p data_type=%d\n", __func__, group, inode, mask, data, data_type); fsn_mark = fsnotify_find_inode_mark(group, inode); if (!fsn_mark) return false; Loading fs/notify/inotify/inotify_user.c +10 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,8 @@ static struct fsnotify_event *get_one_event(struct fsnotify_group *group, event = fsnotify_peek_notify_event(group); pr_debug("%s: group=%p event=%p\n", __func__, group, event); if (event->name_len) event_size += roundup(event->name_len + 1, event_size); Loading Loading @@ -170,6 +172,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, size_t event_size = sizeof(struct inotify_event); size_t name_len = 0; pr_debug("%s: group=%p event=%p\n", __func__, group, event); /* we get the inotify watch descriptor from the event private data */ spin_lock(&event->lock); fsn_priv = fsnotify_remove_priv_from_event(group, event); Loading Loading @@ -242,6 +246,8 @@ static ssize_t inotify_read(struct file *file, char __user *buf, kevent = get_one_event(group, count); mutex_unlock(&group->notification_mutex); pr_debug("%s: group=%p kevent=%p\n", __func__, group, kevent); if (kevent) { ret = PTR_ERR(kevent); if (IS_ERR(kevent)) Loading Loading @@ -286,6 +292,8 @@ static int inotify_release(struct inode *ignored, struct file *file) struct fsnotify_group *group = file->private_data; struct user_struct *user = group->inotify_data.user; pr_debug("%s: group=%p\n", __func__, group); fsnotify_clear_marks_by_group(group); /* free this group, matching get was inotify_init->fsnotify_obtain_group */ Loading @@ -309,6 +317,8 @@ static long inotify_ioctl(struct file *file, unsigned int cmd, group = file->private_data; p = (void __user *) arg; pr_debug("%s: group=%p cmd=%u\n", __func__, group, cmd); switch (cmd) { case FIONREAD: mutex_lock(&group->notification_mutex); Loading fs/notify/notification.c +13 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,8 @@ void fsnotify_put_event(struct fsnotify_event *event) return; if (atomic_dec_and_test(&event->refcnt)) { pr_debug("%s: event=%p\n", __func__, event); if (event->data_type == FSNOTIFY_EVENT_PATH) path_put(&event->path); Loading Loading @@ -146,6 +148,8 @@ int fsnotify_add_notify_event(struct fsnotify_group *group, struct fsnotify_even struct list_head *list = &group->notification_list; int rc = 0; pr_debug("%s: group=%p event=%p priv=%p\n", __func__, group, event, priv); /* * There is one fsnotify_event_holder embedded inside each fsnotify_event. * Check if we expect to be able to use that holder. If not alloc a new Loading Loading @@ -222,6 +226,8 @@ struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group *group BUG_ON(!mutex_is_locked(&group->notification_mutex)); pr_debug("%s: group=%p\n", __func__, group); holder = list_first_entry(&group->notification_list, struct fsnotify_event_holder, event_list); event = holder->event; Loading Loading @@ -307,6 +313,8 @@ int fsnotify_replace_event(struct fsnotify_event_holder *old_holder, SPINLOCK_NEW, }; pr_debug("%s: old_event=%p new_event=%p\n", __func__, old_event, new_event); /* * if the new_event's embedded holder is in use someone * screwed up and didn't give us a clean new event. Loading Loading @@ -340,6 +348,8 @@ struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event) if (!event) return NULL; pr_debug("%s: old_event=%p new_event=%p\n", __func__, old_event, event); memcpy(event, old_event, sizeof(*event)); initialize_event(event); Loading Loading @@ -379,6 +389,9 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, if (!event) return NULL; pr_debug("%s: event=%p to_tell=%p mask=%x data=%p data_type=%d\n", __func__, event, to_tell, mask, data, data_type); initialize_event(event); if (name) { Loading Loading
fs/notify/fsnotify.c +4 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,10 @@ static int send_to_group(struct fsnotify_group *group, struct inode *to_tell, int data_is, u32 cookie, const unsigned char *file_name, struct fsnotify_event **event) { pr_debug("%s: group=%p to_tell=%p mnt=%p mask=%x data=%p data_is=%d" " cookie=%d event=%p\n", __func__, group, to_tell, mnt, mask, data, data_is, cookie, *event); if (!group->ops->should_send_event(group, to_tell, mnt, mask, data, data_is)) return 0; Loading
fs/notify/inotify/inotify_fsnotify.c +6 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev struct fsnotify_event_private_data *fsn_event_priv; int wd, ret; pr_debug("%s: group=%p event=%p to_tell=%p mask=%x\n", __func__, group, event, event->to_tell, event->mask); to_tell = event->to_tell; fsn_mark = fsnotify_find_inode_mark(group, to_tell); Loading Loading @@ -151,6 +154,9 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode struct fsnotify_mark *fsn_mark; bool send; pr_debug("%s: group=%p inode=%p mask=%x data=%p data_type=%d\n", __func__, group, inode, mask, data, data_type); fsn_mark = fsnotify_find_inode_mark(group, inode); if (!fsn_mark) return false; Loading
fs/notify/inotify/inotify_user.c +10 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,8 @@ static struct fsnotify_event *get_one_event(struct fsnotify_group *group, event = fsnotify_peek_notify_event(group); pr_debug("%s: group=%p event=%p\n", __func__, group, event); if (event->name_len) event_size += roundup(event->name_len + 1, event_size); Loading Loading @@ -170,6 +172,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, size_t event_size = sizeof(struct inotify_event); size_t name_len = 0; pr_debug("%s: group=%p event=%p\n", __func__, group, event); /* we get the inotify watch descriptor from the event private data */ spin_lock(&event->lock); fsn_priv = fsnotify_remove_priv_from_event(group, event); Loading Loading @@ -242,6 +246,8 @@ static ssize_t inotify_read(struct file *file, char __user *buf, kevent = get_one_event(group, count); mutex_unlock(&group->notification_mutex); pr_debug("%s: group=%p kevent=%p\n", __func__, group, kevent); if (kevent) { ret = PTR_ERR(kevent); if (IS_ERR(kevent)) Loading Loading @@ -286,6 +292,8 @@ static int inotify_release(struct inode *ignored, struct file *file) struct fsnotify_group *group = file->private_data; struct user_struct *user = group->inotify_data.user; pr_debug("%s: group=%p\n", __func__, group); fsnotify_clear_marks_by_group(group); /* free this group, matching get was inotify_init->fsnotify_obtain_group */ Loading @@ -309,6 +317,8 @@ static long inotify_ioctl(struct file *file, unsigned int cmd, group = file->private_data; p = (void __user *) arg; pr_debug("%s: group=%p cmd=%u\n", __func__, group, cmd); switch (cmd) { case FIONREAD: mutex_lock(&group->notification_mutex); Loading
fs/notify/notification.c +13 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,8 @@ void fsnotify_put_event(struct fsnotify_event *event) return; if (atomic_dec_and_test(&event->refcnt)) { pr_debug("%s: event=%p\n", __func__, event); if (event->data_type == FSNOTIFY_EVENT_PATH) path_put(&event->path); Loading Loading @@ -146,6 +148,8 @@ int fsnotify_add_notify_event(struct fsnotify_group *group, struct fsnotify_even struct list_head *list = &group->notification_list; int rc = 0; pr_debug("%s: group=%p event=%p priv=%p\n", __func__, group, event, priv); /* * There is one fsnotify_event_holder embedded inside each fsnotify_event. * Check if we expect to be able to use that holder. If not alloc a new Loading Loading @@ -222,6 +226,8 @@ struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group *group BUG_ON(!mutex_is_locked(&group->notification_mutex)); pr_debug("%s: group=%p\n", __func__, group); holder = list_first_entry(&group->notification_list, struct fsnotify_event_holder, event_list); event = holder->event; Loading Loading @@ -307,6 +313,8 @@ int fsnotify_replace_event(struct fsnotify_event_holder *old_holder, SPINLOCK_NEW, }; pr_debug("%s: old_event=%p new_event=%p\n", __func__, old_event, new_event); /* * if the new_event's embedded holder is in use someone * screwed up and didn't give us a clean new event. Loading Loading @@ -340,6 +348,8 @@ struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event) if (!event) return NULL; pr_debug("%s: old_event=%p new_event=%p\n", __func__, old_event, event); memcpy(event, old_event, sizeof(*event)); initialize_event(event); Loading Loading @@ -379,6 +389,9 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, if (!event) return NULL; pr_debug("%s: event=%p to_tell=%p mask=%x data=%p data_type=%d\n", __func__, event, to_tell, mask, data, data_type); initialize_event(event); if (name) { Loading