Linux Audio

Check our new training course

Loading...
v4.17
 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 */
 5
 6struct inotify_event_info {
 7	struct fsnotify_event fse;
 
 8	int wd;
 9	u32 sync_cookie;
10	int name_len;
11	char name[];
12};
13
14struct inotify_inode_mark {
15	struct fsnotify_mark fsn_mark;
16	int wd;
17};
18
19static inline struct inotify_event_info *INOTIFY_E(struct fsnotify_event *fse)
20{
21	return container_of(fse, struct inotify_event_info, fse);
22}
23
24extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
25					   struct fsnotify_group *group);
26extern int inotify_handle_event(struct fsnotify_group *group,
27				struct inode *inode,
28				struct fsnotify_mark *inode_mark,
29				struct fsnotify_mark *vfsmount_mark,
30				u32 mask, const void *data, int data_type,
31				const unsigned char *file_name, u32 cookie,
32				struct fsnotify_iter_info *iter_info);
33
34extern const struct fsnotify_ops inotify_fsnotify_ops;
35extern struct kmem_cache *inotify_inode_mark_cachep;
36
37#ifdef CONFIG_INOTIFY_USER
38static inline void dec_inotify_instances(struct ucounts *ucounts)
39{
40	dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES);
41}
42
43static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts)
44{
45	return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES);
46}
47
48static inline void dec_inotify_watches(struct ucounts *ucounts)
49{
50	dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES);
51}
52#endif
v5.4
 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 */
 5
 6struct inotify_event_info {
 7	struct fsnotify_event fse;
 8	u32 mask;
 9	int wd;
10	u32 sync_cookie;
11	int name_len;
12	char name[];
13};
14
15struct inotify_inode_mark {
16	struct fsnotify_mark fsn_mark;
17	int wd;
18};
19
20static inline struct inotify_event_info *INOTIFY_E(struct fsnotify_event *fse)
21{
22	return container_of(fse, struct inotify_event_info, fse);
23}
24
25extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
26					   struct fsnotify_group *group);
27extern int inotify_handle_event(struct fsnotify_group *group,
28				struct inode *inode,
 
 
29				u32 mask, const void *data, int data_type,
30				const struct qstr *file_name, u32 cookie,
31				struct fsnotify_iter_info *iter_info);
32
33extern const struct fsnotify_ops inotify_fsnotify_ops;
34extern struct kmem_cache *inotify_inode_mark_cachep;
35
36#ifdef CONFIG_INOTIFY_USER
37static inline void dec_inotify_instances(struct ucounts *ucounts)
38{
39	dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES);
40}
41
42static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts)
43{
44	return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES);
45}
46
47static inline void dec_inotify_watches(struct ucounts *ucounts)
48{
49	dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES);
50}
51#endif