]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - fs/notify/fsnotify.h
fsnotify: Detach mark from object list when last reference is dropped
[mirror_ubuntu-bionic-kernel.git] / fs / notify / fsnotify.h
CommitLineData
90586523
EP
1#ifndef __FS_NOTIFY_FSNOTIFY_H_
2#define __FS_NOTIFY_FSNOTIFY_H_
3
4#include <linux/list.h>
5#include <linux/fsnotify.h>
6#include <linux/srcu.h>
7#include <linux/types.h>
8
925d1132
JK
9#include "../mount.h"
10
a2d8bc6c
EP
11/* destroy all events sitting in this groups notification queue */
12extern void fsnotify_flush_notify(struct fsnotify_group *group);
13
75c1be48
EP
14/* protects reads of inode and vfsmount marks list */
15extern struct srcu_struct fsnotify_mark_srcu;
16
8edc6e16
JK
17/* compare two groups for sorting of marks lists */
18extern int fsnotify_compare_groups(struct fsnotify_group *a,
19 struct fsnotify_group *b);
20
0809ab69 21/* Find mark belonging to given group in the list of marks */
9dd813c1 22extern struct fsnotify_mark *fsnotify_find_mark(
08991e83
JK
23 struct fsnotify_mark_connector __rcu **connp,
24 struct fsnotify_group *group);
a03e2e4f 25/* Destroy all marks connected via given connector */
08991e83 26extern void fsnotify_destroy_marks(struct fsnotify_mark_connector __rcu **connp);
925d1132
JK
27/* run the list of all marks associated with inode and destroy them */
28static inline void fsnotify_clear_marks_by_inode(struct inode *inode)
29{
08991e83 30 fsnotify_destroy_marks(&inode->i_fsnotify_marks);
925d1132
JK
31}
32/* run the list of all marks associated with vfsmount and destroy them */
33static inline void fsnotify_clear_marks_by_mount(struct vfsmount *mnt)
34{
08991e83 35 fsnotify_destroy_marks(&real_mount(mnt)->mnt_fsnotify_marks);
925d1132 36}
35e48176
JK
37/* prepare for freeing all marks associated with given group */
38extern void fsnotify_detach_group_marks(struct fsnotify_group *group);
39/*
40 * wait for fsnotify_mark_srcu period to end and free all marks in destroy_list
41 */
42extern void fsnotify_mark_destroy_list(void);
43
c28f7e56
EP
44/*
45 * update the dentry->d_flags of all of inode's children to indicate if inode cares
46 * about events that happen to its children.
47 */
48extern void __fsnotify_update_child_dentry_flags(struct inode *inode);
a2d8bc6c
EP
49
50/* allocate and destroy and event holder to attach events to notification/access queues */
51extern struct fsnotify_event_holder *fsnotify_alloc_event_holder(void);
52extern void fsnotify_destroy_event_holder(struct fsnotify_event_holder *holder);
53
90586523 54#endif /* __FS_NOTIFY_FSNOTIFY_H_ */