]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - fs/notify/fanotify/fanotify.h
fanotify: fanotify_mark syscall implementation
[mirror_ubuntu-artful-kernel.git] / fs / notify / fanotify / fanotify.h
1 #include <linux/fanotify.h>
2 #include <linux/fsnotify_backend.h>
3 #include <linux/net.h>
4 #include <linux/kernel.h>
5 #include <linux/types.h>
6
7 extern const struct fsnotify_ops fanotify_fsnotify_ops;
8
9 static inline bool fanotify_mark_flags_valid(unsigned int flags)
10 {
11 /* must be either and add or a remove */
12 if (!(flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)))
13 return false;
14
15 /* cannot be both add and remove */
16 if ((flags & FAN_MARK_ADD) &&
17 (flags & FAN_MARK_REMOVE))
18 return false;
19
20 /* cannot have more flags than we know about */
21 if (flags & ~FAN_ALL_MARK_FLAGS)
22 return false;
23
24 return true;
25 }
26
27 static inline bool fanotify_mask_valid(__u32 mask)
28 {
29 if (mask & ~((__u32)FAN_ALL_INCOMING_EVENTS))
30 return false;
31 return true;
32 }