linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Lieb <jlieb@panasas.com>
To: eparis@redhat.com
Cc: linux-fsdevel@vger.kernel.org, bfields@redhat.com,
	jlayton@redhat.com, Jim Lieb <jlieb@panasas.com>
Subject: [PATCH 3/3] inotify: enable support to ignore self generated events
Date: Wed, 16 Oct 2013 12:13:19 -0700	[thread overview]
Message-ID: <1381950799-4054-4-git-send-email-jlieb@panasas.com> (raw)
In-Reply-To: <1381950799-4054-1-git-send-email-jlieb@panasas.com>

Add IN_IGNORE_ME defined identical with FS_IGNORE_ME.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
---
 fs/notify/inotify/inotify_user.c | 3 ++-
 include/linux/inotify.h          | 3 ++-
 include/uapi/linux/inotify.h     | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index 60f954a..cf5bcf0 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -829,11 +829,12 @@ static int __init inotify_user_setup(void)
 	BUILD_BUG_ON(IN_UNMOUNT != FS_UNMOUNT);
 	BUILD_BUG_ON(IN_Q_OVERFLOW != FS_Q_OVERFLOW);
 	BUILD_BUG_ON(IN_IGNORED != FS_IN_IGNORED);
+	BUILD_BUG_ON(IN_IGNORE_ME != FS_IGNORE_ME);
 	BUILD_BUG_ON(IN_EXCL_UNLINK != FS_EXCL_UNLINK);
 	BUILD_BUG_ON(IN_ISDIR != FS_ISDIR);
 	BUILD_BUG_ON(IN_ONESHOT != FS_IN_ONESHOT);
 
-	BUG_ON(hweight32(ALL_INOTIFY_BITS) != 21);
+	BUG_ON(hweight32(ALL_INOTIFY_BITS) != 22);
 
 	inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark, SLAB_PANIC);
 	event_priv_cachep = KMEM_CACHE(inotify_event_private_data, SLAB_PANIC);
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
index 23aede0..653bea5 100644
--- a/include/linux/inotify.h
+++ b/include/linux/inotify.h
@@ -15,7 +15,8 @@ extern struct ctl_table inotify_table[]; /* for sysctl */
 			  IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
 			  IN_MOVED_TO | IN_CREATE | IN_DELETE | \
 			  IN_DELETE_SELF | IN_MOVE_SELF | IN_UNMOUNT | \
-			  IN_Q_OVERFLOW | IN_IGNORED | IN_ONLYDIR | \
+			  IN_Q_OVERFLOW | IN_IGNORED | \
+			  IN_IGNORE_ME | IN_ONLYDIR |			\
 			  IN_DONT_FOLLOW | IN_EXCL_UNLINK | IN_MASK_ADD | \
 			  IN_ISDIR | IN_ONESHOT)
 
diff --git a/include/uapi/linux/inotify.h b/include/uapi/linux/inotify.h
index e6bf35b..e8f9ab7 100644
--- a/include/uapi/linux/inotify.h
+++ b/include/uapi/linux/inotify.h
@@ -49,6 +49,7 @@ struct inotify_event {
 #define IN_MOVE			(IN_MOVED_FROM | IN_MOVED_TO) /* moves */
 
 /* special flags */
+#define IN_IGNORE_ME		0x00800000	/* don't send events I caused */
 #define IN_ONLYDIR		0x01000000	/* only watch the path if it is a directory */
 #define IN_DONT_FOLLOW		0x02000000	/* don't follow a sym link */
 #define IN_EXCL_UNLINK		0x04000000	/* exclude events on unlinked objects */
@@ -64,7 +65,7 @@ struct inotify_event {
 #define IN_ALL_EVENTS	(IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
 			 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
 			 IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
-			 IN_MOVE_SELF)
+			 IN_MOVE_SELF | IN_IGNORE_ME)
 
 /* Flags for sys_inotify_init1.  */
 #define IN_CLOEXEC O_CLOEXEC
-- 
1.8.3.1


  parent reply	other threads:[~2013-10-16 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16 19:13 [PATCH 0/3] fsnotify - Add support for ignoring self initiated events Jim Lieb
2013-10-16 19:13 ` [PATCH 1/3] fsnotify: add support for ignoring events from self Jim Lieb
2013-10-16 19:13 ` [PATCH 2/3] fanotify: enable support for ignoring self generated events Jim Lieb
2013-10-16 19:13 ` Jim Lieb [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-09-04 18:30 RFC: fsnotify - Add support for ignoring self initiated events Jim Lieb
2013-09-04 18:31 ` [PATCH 3/3] inotify: enable support to ignore self generated events Jim Lieb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381950799-4054-4-git-send-email-jlieb@panasas.com \
    --to=jlieb@panasas.com \
    --cc=bfields@redhat.com \
    --cc=eparis@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).