summaryrefslogtreecommitdiff
path: root/include/linux/fanotify.h
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2022-06-29 17:42:09 +0300
committerJan Kara <jack@suse.cz>2022-07-01 15:51:49 +0300
commit8afd7215aa97f8868d033f6e1d01a276ab2d29c0 (patch)
tree5e5db4b5d657460abb6165b38821d3de13464165 /include/linux/fanotify.h
parent31a371e419c885e0f137ce70395356ba8639dc52 (diff)
downloadlinux-8afd7215aa97f8868d033f6e1d01a276ab2d29c0.tar.xz
fanotify: cleanups for fanotify_mark() input validations
Create helper fanotify_may_update_existing_mark() for checking for conflicts between existing mark flags and fanotify_mark() flags. Use variable mark_cmd to make the checks for mark command bits cleaner. Link: https://lore.kernel.org/r/20220629144210.2983229-3-amir73il@gmail.com Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux/fanotify.h')
-rw-r--r--include/linux/fanotify.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index e517dbcf74ed..a7207f092fd1 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -59,15 +59,16 @@
#define FANOTIFY_MARK_TYPE_BITS (FAN_MARK_INODE | FAN_MARK_MOUNT | \
FAN_MARK_FILESYSTEM)
+#define FANOTIFY_MARK_CMD_BITS (FAN_MARK_ADD | FAN_MARK_REMOVE | \
+ FAN_MARK_FLUSH)
+
#define FANOTIFY_MARK_FLAGS (FANOTIFY_MARK_TYPE_BITS | \
- FAN_MARK_ADD | \
- FAN_MARK_REMOVE | \
+ FANOTIFY_MARK_CMD_BITS | \
FAN_MARK_DONT_FOLLOW | \
FAN_MARK_ONLYDIR | \
FAN_MARK_IGNORED_MASK | \
FAN_MARK_IGNORED_SURV_MODIFY | \
- FAN_MARK_EVICTABLE | \
- FAN_MARK_FLUSH)
+ FAN_MARK_EVICTABLE)
/*
* Events that can be reported with data type FSNOTIFY_EVENT_PATH.