From 6e5f77b32e9097a8a68a8d453799676cacf70cad Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Thu, 17 Dec 2009 21:24:34 -0500 Subject: fsnotify: intoduce a notification merge argument Each group can define their own notification (and secondary_q) merge function. Inotify does tail drop, fanotify does matching and drop which can actually allocate a completely new event. But for fanotify to properly deal with permissions events it needs to know the new event which was ultimately added to the notification queue. This patch just implements a void ** argument which is passed to the merge function. fanotify can use this field to pass the new event back to higher layers. Signed-off-by: Eric Paris for fanotify to properly deal with permissions events --- fs/notify/fanotify/fanotify.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fs/notify/fanotify') diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index 060b177146e8..95a330d2f8a1 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -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; @@ -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; -- cgit v1.2.3-59-g8ed1b