From 077e24c8872f57c86ce3a0f1ed858bd788027c83 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Thu, 17 Dec 2009 21:24:25 -0500 Subject: [PATCH] --- yaml --- r: 207654 b: refs/heads/master c: 9dced01a0939f3e952eca8c21427ceec1f473dcf h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/notify/fanotify/fanotify.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e99ed8d3830d..04a15064941d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a12a7dd3284f5644326af1ea53b35030f205dd29 +refs/heads/master: 9dced01a0939f3e952eca8c21427ceec1f473dcf diff --git a/trunk/fs/notify/fanotify/fanotify.c b/trunk/fs/notify/fanotify/fanotify.c index 8e574d6f6a80..5b0b6b485a9c 100644 --- a/trunk/fs/notify/fanotify/fanotify.c +++ b/trunk/fs/notify/fanotify/fanotify.c @@ -46,6 +46,16 @@ static int fanotify_merge(struct list_head *list, struct fsnotify_event *event) if (test_event->mask == event->mask) goto out; + /* + * if the refcnt == 1 this is the only queue + * for this event and so we can update the mask + * in place. + */ + if (atomic_read(&test_event->refcnt) == 1) { + test_event->mask |= event->mask; + goto out; + } + /* can't allocate memory, merge was no possible */ new_event = fsnotify_clone_event(test_event); if (unlikely(!new_event)) {