From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Lieb Subject: [PATCH 2/3] fanotify: enable support for ignoring self generated events Date: Wed, 4 Sep 2013 11:31:01 -0700 Message-ID: <1378319462-4767-3-git-send-email-jlieb@panasas.com> References: <1378319462-4767-1-git-send-email-jlieb@panasas.com> Cc: Jim Lieb To: linux-fsdevel@vger.kernel.org Return-path: Received: from natasha.panasas.com ([67.152.220.90]:41262 "EHLO natasha.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756562Ab3IDSbb (ORCPT ); Wed, 4 Sep 2013 14:31:31 -0400 In-Reply-To: <1378319462-4767-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..93e9f09 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 /* do not send me events I caused */ #define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ /* helper events */ -- 1.8.3.1