diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-10-30 16:16:56 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-10-30 16:16:56 -0400 |
commit | f1e095f1d206b81b44160f41278ce5c78641e9b7 (patch) | |
tree | bd293d46d2d3e4cdf435a22ddb2877c6ba1b8acc /include/linux/fanotify.h | |
parent | b0438a1b71955c425c304a2a483765ef24841766 (diff) | |
parent | 1792f17b7210280a3d7ff29da9614ba779cfcedb (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'include/linux/fanotify.h')
-rw-r--r-- | include/linux/fanotify.h | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h index 63531a6b4d2a..0f0121467fc4 100644 --- a/include/linux/fanotify.h +++ b/include/linux/fanotify.h | |||
@@ -6,18 +6,19 @@ | |||
6 | /* the following events that user-space can register for */ | 6 | /* the following events that user-space can register for */ |
7 | #define FAN_ACCESS 0x00000001 /* File was accessed */ | 7 | #define FAN_ACCESS 0x00000001 /* File was accessed */ |
8 | #define FAN_MODIFY 0x00000002 /* File was modified */ | 8 | #define FAN_MODIFY 0x00000002 /* File was modified */ |
9 | #define FAN_CLOSE_WRITE 0x00000008 /* Unwrittable file closed */ | 9 | #define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */ |
10 | #define FAN_CLOSE_NOWRITE 0x00000010 /* Writtable file closed */ | 10 | #define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */ |
11 | #define FAN_OPEN 0x00000020 /* File was opened */ | 11 | #define FAN_OPEN 0x00000020 /* File was opened */ |
12 | 12 | ||
13 | #define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ | ||
14 | |||
15 | /* FIXME currently Q's have no limit.... */ | ||
16 | #define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ | 13 | #define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ |
17 | 14 | ||
18 | #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ | 15 | #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ |
19 | #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ | 16 | #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ |
20 | 17 | ||
18 | #define FAN_ONDIR 0x40000000 /* event occurred against dir */ | ||
19 | |||
20 | #define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ | ||
21 | |||
21 | /* helper events */ | 22 | /* helper events */ |
22 | #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ | 23 | #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ |
23 | 24 | ||
@@ -25,7 +26,19 @@ | |||
25 | #define FAN_CLOEXEC 0x00000001 | 26 | #define FAN_CLOEXEC 0x00000001 |
26 | #define FAN_NONBLOCK 0x00000002 | 27 | #define FAN_NONBLOCK 0x00000002 |
27 | 28 | ||
28 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK) | 29 | /* These are NOT bitwise flags. Both bits are used togther. */ |
30 | #define FAN_CLASS_NOTIF 0x00000000 | ||
31 | #define FAN_CLASS_CONTENT 0x00000004 | ||
32 | #define FAN_CLASS_PRE_CONTENT 0x00000008 | ||
33 | #define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \ | ||
34 | FAN_CLASS_PRE_CONTENT) | ||
35 | |||
36 | #define FAN_UNLIMITED_QUEUE 0x00000010 | ||
37 | #define FAN_UNLIMITED_MARKS 0x00000020 | ||
38 | |||
39 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ | ||
40 | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\ | ||
41 | FAN_UNLIMITED_MARKS) | ||
29 | 42 | ||
30 | /* flags used for fanotify_modify_mark() */ | 43 | /* flags used for fanotify_modify_mark() */ |
31 | #define FAN_MARK_ADD 0x00000001 | 44 | #define FAN_MARK_ADD 0x00000001 |
@@ -36,6 +49,10 @@ | |||
36 | #define FAN_MARK_IGNORED_MASK 0x00000020 | 49 | #define FAN_MARK_IGNORED_MASK 0x00000020 |
37 | #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 | 50 | #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 |
38 | #define FAN_MARK_FLUSH 0x00000080 | 51 | #define FAN_MARK_FLUSH 0x00000080 |
52 | #ifdef __KERNEL__ | ||
53 | /* not valid from userspace, only kernel internal */ | ||
54 | #define FAN_MARK_ONDIR 0x00000100 | ||
55 | #endif | ||
39 | 56 | ||
40 | #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ | 57 | #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ |
41 | FAN_MARK_REMOVE |\ | 58 | FAN_MARK_REMOVE |\ |
@@ -43,7 +60,8 @@ | |||
43 | FAN_MARK_ONLYDIR |\ | 60 | FAN_MARK_ONLYDIR |\ |
44 | FAN_MARK_MOUNT |\ | 61 | FAN_MARK_MOUNT |\ |
45 | FAN_MARK_IGNORED_MASK |\ | 62 | FAN_MARK_IGNORED_MASK |\ |
46 | FAN_MARK_IGNORED_SURV_MODIFY) | 63 | FAN_MARK_IGNORED_SURV_MODIFY |\ |
64 | FAN_MARK_FLUSH) | ||
47 | 65 | ||
48 | /* | 66 | /* |
49 | * All of the events - we build the list by hand so that we can add flags in | 67 | * All of the events - we build the list by hand so that we can add flags in |
@@ -70,10 +88,10 @@ | |||
70 | struct fanotify_event_metadata { | 88 | struct fanotify_event_metadata { |
71 | __u32 event_len; | 89 | __u32 event_len; |
72 | __u32 vers; | 90 | __u32 vers; |
73 | __u64 mask; | 91 | __aligned_u64 mask; |
74 | __s32 fd; | 92 | __s32 fd; |
75 | __s32 pid; | 93 | __s32 pid; |
76 | } __attribute__ ((packed)); | 94 | }; |
77 | 95 | ||
78 | struct fanotify_response { | 96 | struct fanotify_response { |
79 | __s32 fd; | 97 | __s32 fd; |