History

fanotify: add API to attach/detach super block mark

Add another mark type flag FAN_MARK_FILESYSTEM for add/remove/flush of super block mark type. A super block watch gets all events on the filesystem, regardless of the mount from which the mark was added, unless an ignore mask exists on either the inode or the mount where the event was generated. Only one of FAN_MARK_MOUNT and FAN_MARK_FILESYSTEM mark type flags may be provided to fanotify_mark() or no mark type flag for inode mark.

Amir Goldstein committed 8 years ago

Commit d54f4fb1 parent 60f7ed82 files · +49 −9Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/fanotify.h+12−4
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #define FAN_CLOEXEC 0x00000001
2828 #define FAN_NONBLOCK 0x00000002
2929
30−/* These are NOT bitwise flags. Both bits are used togther. */
30+/* These are NOT bitwise flags. Both bits are used together. */
3131 #define FAN_CLASS_NOTIF 0x00000000
3232 #define FAN_CLASS_CONTENT 0x00000004
3333 #define FAN_CLASS_PRE_CONTENT 0x00000008
@@ -47,19 +47,27 @@ · 13 unmodified lines
4747 #define FAN_MARK_REMOVE 0x00000002
4848 #define FAN_MARK_DONT_FOLLOW 0x00000004
4949 #define FAN_MARK_ONLYDIR 0x00000008
50−#define FAN_MARK_MOUNT 0x00000010
50+/* FAN_MARK_MOUNT is 0x00000010 */
5151 #define FAN_MARK_IGNORED_MASK 0x00000020
5252 #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
5353 #define FAN_MARK_FLUSH 0x00000080
54+/* FAN_MARK_FILESYSTEM is 0x00000100 */
55+
56+/* These are NOT bitwise flags. Both bits can be used togther. */
57+#define FAN_MARK_INODE 0x00000000
58+#define FAN_MARK_MOUNT 0x00000010
59+#define FAN_MARK_FILESYSTEM 0x00000100
60+#define FAN_MARK_TYPE_MASK (FAN_MARK_INODE | FAN_MARK_MOUNT | \
61+ FAN_MARK_FILESYSTEM)
5462
5563 #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
5664 FAN_MARK_REMOVE |\
5765 FAN_MARK_DONT_FOLLOW |\
5866 FAN_MARK_ONLYDIR |\
59− FAN_MARK_MOUNT |\
6067 FAN_MARK_IGNORED_MASK |\
6168 FAN_MARK_IGNORED_SURV_MODIFY |\
62− FAN_MARK_FLUSH)
69+ FAN_MARK_FLUSH|\
70+ FAN_MARK_TYPE_MASK)
6371
6472 /*
6573 * All of the events - we build the list by hand so that we can add flags in