From: Jim Lieb Subject: [PATCH 2/3] fanotify: enable support for ignoring self generated events Date: Wed, 16 Oct 2013 12:13:18 -0700 Message-ID: <1381950799-4054-3-git-send-email-jlieb@panasas.com> References: <1381950799-4054-1-git-send-email-jlieb@panasas.com> Cc: linux-fsdevel@vger.kernel.org, bfields@redhat.com, jlayton@redhat.com, Jim Lieb To: eparis@redhat.com Return-path: Received: from natasha.panasas.com ([67.152.220.90]:37386 "EHLO natasha.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757772Ab3JPTNs (ORCPT ); Wed, 16 Oct 2013 15:13:48 -0400 In-Reply-To: <1381950799-4054-1-git-send-email-jlieb@panasas.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Add FAN_IGNORE_ME flag definition to be identical to FS_IGNORE_ME. Signed-off-by: Jim Lieb --- fs/notify/fanotify/fanotify_user.c | 5 +++-- include/uapi/linux/fanotify.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index e44cb64..963a023 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -815,9 +815,10 @@ SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, } #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS - if (mask & ~(FAN_ALL_EVENTS | FAN_ALL_PERM_EVENTS | FAN_EVENT_ON_CHILD)) + if (mask & ~(FAN_ALL_EVENTS | FAN_ALL_PERM_EVENTS | + FAN_IGNORE_ME | FAN_EVENT_ON_CHILD)) #else - if (mask & ~(FAN_ALL_EVENTS | FAN_EVENT_ON_CHILD)) + if (mask & ~(FAN_ALL_EVENTS | FAN_IGNORE_ME | FAN_EVENT_ON_CHILD)) #endif return -EINVAL; diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h index 030508d..f3406bd 100644 --- a/include/uapi/linux/fanotify.h +++ b/include/uapi/linux/fanotify.h @@ -17,6 +17,7 @@ #define FAN_ONDIR 0x40000000 /* event occurred against dir */ +#define FAN_IGNORE_ME 0x00800000 /* don't send events I caused */ #define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ /* helper events */ -- 1.8.3.1