diff options
Diffstat (limited to 'include/linux/fsnotify_backend.h')
-rw-r--r-- | include/linux/fsnotify_backend.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index e40190d16878..0a68f924f06f 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -45,7 +45,7 @@ | |||
45 | #define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */ | 45 | #define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */ |
46 | 46 | ||
47 | #define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */ | 47 | #define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */ |
48 | #define FS_IN_ISDIR 0x40000000 /* event occurred against dir */ | 48 | #define FS_ISDIR 0x40000000 /* event occurred against dir */ |
49 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ | 49 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ |
50 | 50 | ||
51 | #define FS_DN_RENAME 0x10000000 /* file renamed */ | 51 | #define FS_DN_RENAME 0x10000000 /* file renamed */ |
@@ -64,13 +64,15 @@ | |||
64 | 64 | ||
65 | #define FS_MOVE (FS_MOVED_FROM | FS_MOVED_TO) | 65 | #define FS_MOVE (FS_MOVED_FROM | FS_MOVED_TO) |
66 | 66 | ||
67 | #define ALL_FSNOTIFY_PERM_EVENTS (FS_OPEN_PERM | FS_ACCESS_PERM) | ||
68 | |||
67 | #define ALL_FSNOTIFY_EVENTS (FS_ACCESS | FS_MODIFY | FS_ATTRIB | \ | 69 | #define ALL_FSNOTIFY_EVENTS (FS_ACCESS | FS_MODIFY | FS_ATTRIB | \ |
68 | FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN | \ | 70 | FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN | \ |
69 | FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE | \ | 71 | FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE | \ |
70 | FS_DELETE | FS_DELETE_SELF | FS_MOVE_SELF | \ | 72 | FS_DELETE | FS_DELETE_SELF | FS_MOVE_SELF | \ |
71 | FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \ | 73 | FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \ |
72 | FS_OPEN_PERM | FS_ACCESS_PERM | FS_EXCL_UNLINK | \ | 74 | FS_OPEN_PERM | FS_ACCESS_PERM | FS_EXCL_UNLINK | \ |
73 | FS_IN_ISDIR | FS_IN_ONESHOT | FS_DN_RENAME | \ | 75 | FS_ISDIR | FS_IN_ONESHOT | FS_DN_RENAME | \ |
74 | FS_DN_MULTISHOT | FS_EVENT_ON_CHILD) | 76 | FS_DN_MULTISHOT | FS_EVENT_ON_CHILD) |
75 | 77 | ||
76 | struct fsnotify_group; | 78 | struct fsnotify_group; |
@@ -129,6 +131,14 @@ struct fsnotify_group { | |||
129 | wait_queue_head_t notification_waitq; /* read() on the notification file blocks on this waitq */ | 131 | wait_queue_head_t notification_waitq; /* read() on the notification file blocks on this waitq */ |
130 | unsigned int q_len; /* events on the queue */ | 132 | unsigned int q_len; /* events on the queue */ |
131 | unsigned int max_events; /* maximum events allowed on the list */ | 133 | unsigned int max_events; /* maximum events allowed on the list */ |
134 | /* | ||
135 | * Valid fsnotify group priorities. Events are send in order from highest | ||
136 | * priority to lowest priority. We default to the lowest priority. | ||
137 | */ | ||
138 | #define FS_PRIO_0 0 /* normal notifiers, no permissions */ | ||
139 | #define FS_PRIO_1 1 /* fanotify content based access control */ | ||
140 | #define FS_PRIO_2 2 /* fanotify pre-content access */ | ||
141 | unsigned int priority; | ||
132 | 142 | ||
133 | /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ | 143 | /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ |
134 | spinlock_t mark_lock; /* protect marks_list */ | 144 | spinlock_t mark_lock; /* protect marks_list */ |
@@ -159,6 +169,8 @@ struct fsnotify_group { | |||
159 | bool bypass_perm; /* protected by access_mutex */ | 169 | bool bypass_perm; /* protected by access_mutex */ |
160 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ | 170 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ |
161 | int f_flags; | 171 | int f_flags; |
172 | unsigned int max_marks; | ||
173 | struct user_struct *user; | ||
162 | } fanotify_data; | 174 | } fanotify_data; |
163 | #endif /* CONFIG_FANOTIFY */ | 175 | #endif /* CONFIG_FANOTIFY */ |
164 | }; | 176 | }; |
@@ -275,8 +287,8 @@ struct fsnotify_mark { | |||
275 | struct fsnotify_inode_mark i; | 287 | struct fsnotify_inode_mark i; |
276 | struct fsnotify_vfsmount_mark m; | 288 | struct fsnotify_vfsmount_mark m; |
277 | }; | 289 | }; |
278 | __u32 ignored_mask; /* events types to ignore */ | ||
279 | struct list_head free_g_list; /* tmp list used when freeing this mark */ | 290 | struct list_head free_g_list; /* tmp list used when freeing this mark */ |
291 | __u32 ignored_mask; /* events types to ignore */ | ||
280 | #define FSNOTIFY_MARK_FLAG_INODE 0x01 | 292 | #define FSNOTIFY_MARK_FLAG_INODE 0x01 |
281 | #define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 | 293 | #define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 |
282 | #define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04 | 294 | #define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04 |
@@ -294,7 +306,7 @@ struct fsnotify_mark { | |||
294 | /* main fsnotify call to send events */ | 306 | /* main fsnotify call to send events */ |
295 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | 307 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
296 | const unsigned char *name, u32 cookie); | 308 | const unsigned char *name, u32 cookie); |
297 | extern void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); | 309 | extern int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); |
298 | extern void __fsnotify_inode_delete(struct inode *inode); | 310 | extern void __fsnotify_inode_delete(struct inode *inode); |
299 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); | 311 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); |
300 | extern u32 fsnotify_get_cookie(void); | 312 | extern u32 fsnotify_get_cookie(void); |
@@ -423,8 +435,10 @@ static inline int fsnotify(struct inode *to_tell, __u32 mask, void *data, int da | |||
423 | return 0; | 435 | return 0; |
424 | } | 436 | } |
425 | 437 | ||
426 | static inline void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 438 | static inline int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) |
427 | {} | 439 | { |
440 | return 0; | ||
441 | } | ||
428 | 442 | ||
429 | static inline void __fsnotify_inode_delete(struct inode *inode) | 443 | static inline void __fsnotify_inode_delete(struct inode *inode) |
430 | {} | 444 | {} |