summaryrefslogtreecommitdiffstats
path: root/include/linux/fanotify.h
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2010-10-28 17:21:59 -0400
committerEric Paris <eparis@redhat.com>2010-10-28 17:22:16 -0400
commit8fcd65280abc4699510f1853ede31f43e8a3783a (patch)
tree9ef20b7c3ee0a4130d88922d7d4115beaa0c9dc0 /include/linux/fanotify.h
parentb29866aab8489487f11cc4506590ac31bdbae22a (diff)
downloadop-kernel-dev-8fcd65280abc4699510f1853ede31f43e8a3783a.zip
op-kernel-dev-8fcd65280abc4699510f1853ede31f43e8a3783a.tar.gz
fanotify: ignore events on directories unless specifically requested
fanotify has a very limited number of events it sends on directories. The usefulness of these events is yet to be seen and still we send them. This is particularly painful for mount marks where one might receive many of these useless events. As such this patch will drop events on IS_DIR() inodes unless they were explictly requested with FAN_ON_DIR. This means that a mark on a directory without FAN_EVENT_ON_CHILD or FAN_ON_DIR is meaningless and will result in no events ever (although it will still be allowed since detecting it is hard) Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'include/linux/fanotify.h')
-rw-r--r--include/linux/fanotify.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index 7592a36..5e0400a 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -10,13 +10,15 @@
#define FAN_CLOSE_NOWRITE 0x00000010 /* Writtable file closed */
#define FAN_OPEN 0x00000020 /* File was opened */
-#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
-
#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
+#define FAN_ONDIR 0x40000000 /* event occurred against dir */
+
+#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
+
/* helper events */
#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
@@ -47,6 +49,10 @@
#define FAN_MARK_IGNORED_MASK 0x00000020
#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
#define FAN_MARK_FLUSH 0x00000080
+#ifdef __KERNEL__
+/* not valid from userspace, only kernel internal */
+#define FAN_MARK_ONDIR 0x00000100
+#endif
#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
FAN_MARK_REMOVE |\
OpenPOWER on IntegriCloud