Linux 4.19-rc7
[linux-2.6/btrfs-unstable.git] / fs / notify / inotify / inotify.h
blob7e4578d35b613ce97b87a53e50b2b34df0561e37
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/fsnotify_backend.h>
3 #include <linux/inotify.h>
4 #include <linux/slab.h> /* struct kmem_cache */
6 struct inotify_event_info {
7 struct fsnotify_event fse;
8 int wd;
9 u32 sync_cookie;
10 int name_len;
11 char name[];
14 struct inotify_inode_mark {
15 struct fsnotify_mark fsn_mark;
16 int wd;
19 static inline struct inotify_event_info *INOTIFY_E(struct fsnotify_event *fse)
21 return container_of(fse, struct inotify_event_info, fse);
24 extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
25 struct fsnotify_group *group);
26 extern int inotify_handle_event(struct fsnotify_group *group,
27 struct inode *inode,
28 u32 mask, const void *data, int data_type,
29 const unsigned char *file_name, u32 cookie,
30 struct fsnotify_iter_info *iter_info);
32 extern const struct fsnotify_ops inotify_fsnotify_ops;
33 extern struct kmem_cache *inotify_inode_mark_cachep;
35 #ifdef CONFIG_INOTIFY_USER
36 static inline void dec_inotify_instances(struct ucounts *ucounts)
38 dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES);
41 static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts)
43 return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES);
46 static inline void dec_inotify_watches(struct ucounts *ucounts)
48 dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES);
50 #endif