Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207690
b: refs/heads/master
c: 6e5f77b
h: refs/heads/master
v: v3
  • Loading branch information
Eric Paris committed Jul 28, 2010
1 parent 8e73dcb commit 8076647
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb2d429faf2cae62d3c51e28099a181d5fe8c244
refs/heads/master: 6e5f77b32e9097a8a68a8d453799676cacf70cad
6 changes: 4 additions & 2 deletions trunk/fs/notify/fanotify/fanotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new)
return false;
}

static int fanotify_merge(struct list_head *list, struct fsnotify_event *event)
static int fanotify_merge(struct list_head *list,
struct fsnotify_event *event,
void **arg)
{
struct fsnotify_event_holder *test_holder;
struct fsnotify_event *test_event;
Expand Down Expand Up @@ -92,7 +94,7 @@ static int fanotify_handle_event(struct fsnotify_group *group, struct fsnotify_e

pr_debug("%s: group=%p event=%p\n", __func__, group, event);

ret = fsnotify_add_notify_event(group, event, NULL, fanotify_merge);
ret = fsnotify_add_notify_event(group, event, NULL, fanotify_merge, NULL);
/* -EEXIST means this event was merged with another, not that it was an error */
if (ret == -EEXIST)
ret = 0;
Expand Down
6 changes: 4 additions & 2 deletions trunk/fs/notify/inotify/inotify_fsnotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ static bool event_compare(struct fsnotify_event *old, struct fsnotify_event *new
return false;
}

static int inotify_merge(struct list_head *list, struct fsnotify_event *event)
static int inotify_merge(struct list_head *list,
struct fsnotify_event *event,
void **arg)
{
struct fsnotify_event_holder *last_holder;
struct fsnotify_event *last_event;
Expand Down Expand Up @@ -114,7 +116,7 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev
fsn_event_priv->group = group;
event_priv->wd = wd;

ret = fsnotify_add_notify_event(group, event, fsn_event_priv, inotify_merge);
ret = fsnotify_add_notify_event(group, event, fsn_event_priv, inotify_merge, NULL);
if (ret) {
inotify_free_event_priv(fsn_event_priv);
/* EEXIST says we tail matched, EOVERFLOW isn't something
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
fsn_event_priv->group = group;
event_priv->wd = i_mark->wd;

ret = fsnotify_add_notify_event(group, ignored_event, fsn_event_priv, NULL);
ret = fsnotify_add_notify_event(group, ignored_event, fsn_event_priv, NULL, NULL);
if (ret)
inotify_free_event_priv(fsn_event_priv);

Expand Down
7 changes: 5 additions & 2 deletions trunk/fs/notify/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ struct fsnotify_event_private_data *fsnotify_remove_priv_from_event(struct fsnot
*/
int fsnotify_add_notify_event(struct fsnotify_group *group, struct fsnotify_event *event,
struct fsnotify_event_private_data *priv,
int (*merge)(struct list_head *, struct fsnotify_event *))
int (*merge)(struct list_head *,
struct fsnotify_event *,
void **arg),
void **arg)
{
struct fsnotify_event_holder *holder = NULL;
struct list_head *list = &group->notification_list;
Expand Down Expand Up @@ -170,7 +173,7 @@ int fsnotify_add_notify_event(struct fsnotify_group *group, struct fsnotify_even
if (!list_empty(list) && merge) {
int ret;

ret = merge(list, event);
ret = merge(list, event, arg);
if (ret) {
mutex_unlock(&group->notification_mutex);
if (holder != &event->holder)
Expand Down
5 changes: 4 additions & 1 deletion trunk/include/linux/fsnotify_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,10 @@ extern struct fsnotify_event_private_data *fsnotify_remove_priv_from_event(struc
extern int fsnotify_add_notify_event(struct fsnotify_group *group,
struct fsnotify_event *event,
struct fsnotify_event_private_data *priv,
int (*merge)(struct list_head *, struct fsnotify_event *));
int (*merge)(struct list_head *,
struct fsnotify_event *,
void **),
void **arg);
/* true if the group notification queue is empty */
extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group);
/* return, but do not dequeue the first event on the notification queue */
Expand Down

0 comments on commit 8076647

Please sign in to comment.