]> asedeno.scripts.mit.edu Git - linux.git/blob - fs/notify/inotify/inotify.h
7a966f456269dd712291cdc3d81084b10be4c575
[linux.git] / fs / notify / inotify / inotify.h
1 #include <linux/fsnotify_backend.h>
2 #include <linux/inotify.h>
3 #include <linux/slab.h> /* struct kmem_cache */
4
5 struct inotify_event_info {
6         struct fsnotify_event fse;
7         int wd;
8         u32 sync_cookie;
9         int name_len;
10         char name[];
11 };
12
13 struct inotify_inode_mark {
14         struct fsnotify_mark fsn_mark;
15         int wd;
16 };
17
18 static inline struct inotify_event_info *INOTIFY_E(struct fsnotify_event *fse)
19 {
20         return container_of(fse, struct inotify_event_info, fse);
21 }
22
23 extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
24                                            struct fsnotify_group *group);
25 extern int inotify_handle_event(struct fsnotify_group *group,
26                                 struct inode *inode,
27                                 struct fsnotify_mark *inode_mark,
28                                 struct fsnotify_mark *vfsmount_mark,
29                                 u32 mask, const void *data, int data_type,
30                                 const unsigned char *file_name, u32 cookie,
31                                 struct fsnotify_iter_info *iter_info);
32
33 extern const struct fsnotify_ops inotify_fsnotify_ops;
34
35 #ifdef CONFIG_INOTIFY_USER
36 static inline void dec_inotify_instances(struct ucounts *ucounts)
37 {
38         dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES);
39 }
40
41 static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts)
42 {
43         return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES);
44 }
45
46 static inline void dec_inotify_watches(struct ucounts *ucounts)
47 {
48         dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES);
49 }
50 #endif