| From 59b516d5273091564e47b7444041b97b06754c94 Mon Sep 17 00:00:00 2001 |
| From: Amir Goldstein <amir73il@gmail.com> |
| Date: Sat, 1 Sep 2018 10:41:13 +0300 |
| Subject: [PATCH] BACKPORT: 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. |
| |
| Cc: <linux-api@vger.kernel.org> |
| Signed-off-by: Amir Goldstein <amir73il@gmail.com> |
| Signed-off-by: Jan Kara <jack@suse.cz> |
| --- |
| include/uapi/linux/fanotify.h | 16 ++++++++++++---- |
| 1 file changed, 12 insertions(+), 4 deletions(-) |
| |
| diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h |
| index f79c4e1a84b9..faca2886a584 100644 |
| --- a/include/uapi/linux/fanotify.h |
| +++ b/include/uapi/linux/fanotify.h |
| @@ -27,7 +27,7 @@ |
| #define FAN_CLOEXEC 0x00000001 |
| #define FAN_NONBLOCK 0x00000002 |
| |
| -/* These are NOT bitwise flags. Both bits are used togther. */ |
| +/* These are NOT bitwise flags. Both bits are used together. */ |
| #define FAN_CLASS_NOTIF 0x00000000 |
| #define FAN_CLASS_CONTENT 0x00000004 |
| #define FAN_CLASS_PRE_CONTENT 0x00000008 |
| @@ -46,19 +46,27 @@ |
| #define FAN_MARK_REMOVE 0x00000002 |
| #define FAN_MARK_DONT_FOLLOW 0x00000004 |
| #define FAN_MARK_ONLYDIR 0x00000008 |
| -#define FAN_MARK_MOUNT 0x00000010 |
| +/* FAN_MARK_MOUNT is 0x00000010 */ |
| #define FAN_MARK_IGNORED_MASK 0x00000020 |
| #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 |
| #define FAN_MARK_FLUSH 0x00000080 |
| +/* FAN_MARK_FILESYSTEM is 0x00000100 */ |
| + |
| +/* These are NOT bitwise flags. Both bits can be used togther. */ |
| +#define FAN_MARK_INODE 0x00000000 |
| +#define FAN_MARK_MOUNT 0x00000010 |
| +#define FAN_MARK_FILESYSTEM 0x00000100 |
| +#define FAN_MARK_TYPE_MASK (FAN_MARK_INODE | FAN_MARK_MOUNT | \ |
| + FAN_MARK_FILESYSTEM) |
| |
| #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ |
| FAN_MARK_REMOVE |\ |
| FAN_MARK_DONT_FOLLOW |\ |
| FAN_MARK_ONLYDIR |\ |
| - FAN_MARK_MOUNT |\ |
| FAN_MARK_IGNORED_MASK |\ |
| FAN_MARK_IGNORED_SURV_MODIFY |\ |
| - FAN_MARK_FLUSH) |
| + FAN_MARK_FLUSH|\ |
| + FAN_MARK_TYPE_MASK) |
| |
| /* |
| * All of the events - we build the list by hand so that we can add flags in |
| -- |
| 2.38.1.431.g37b22c650d-goog |
| |