38
38
struct au_hinotify {
39
39
#ifdef CONFIG_AUFS_HINOTIFY
40
spinlock_t hin_ignore_lock;
41
struct list_head hin_ignore_list;
40
43
struct inotify_watch hin_watch;
41
44
struct inode *hin_aufs_inode; /* no get/put */
43
/* an array of atomic_t X au_hin_nignore */
44
atomic_t hin_ignore[0];
76
86
int au_hin_alloc(struct au_hinode *hinode, struct inode *inode,
77
87
struct inode *h_inode);
78
88
void au_hin_free(struct au_hinode *hinode);
79
void au_do_hdir_lock(struct inode *h_dir, struct inode *dir,
80
aufs_bindex_t bindex, unsigned int lsc);
81
void au_hdir_unlock(struct inode *h_dir, struct inode *dir,
82
aufs_bindex_t bindex);
83
struct dentry *au_hdir_lock_rename(struct dentry **h_parents,
84
struct inode **dirs, aufs_bindex_t bindex,
86
void au_hdir_unlock_rename(struct dentry **h_parents, struct inode **dirs,
87
aufs_bindex_t bindex, int issamedir);
89
void au_hin_ctl(struct au_hinode *hinode, const __u32 mask);
88
90
void au_reset_hinotify(struct inode *inode, unsigned int flags);
90
void au_hin_ignore(struct au_hinode *hinode, __u32 events);
91
void au_hin_unignore(struct au_hinode *hinode, __u32 events);
93
92
int __init au_inotify_init(void);
94
93
void au_inotify_fin(void);
95
static inline void au_hin_suspend(struct au_hinode *hinode)
97
au_hin_ctl(hinode, 0);
100
static inline void au_hin_resume(struct au_hinode *hinode)
102
au_hin_ctl(hinode, AuInMask);
117
void au_do_hdir_lock(struct inode *h_dir, struct inode *dir,
118
aufs_bindex_t bindex, unsigned int lsc)
120
mutex_lock_nested(&h_dir->i_mutex, lsc);
124
void au_hdir_unlock(struct inode *h_dir, struct inode *dir,
125
aufs_bindex_t bindex)
127
mutex_unlock(&h_dir->i_mutex);
131
struct dentry *au_hdir_lock_rename(struct dentry **h_parents,
132
struct inode **dirs, aufs_bindex_t bindex,
135
return vfsub_lock_rename(h_parents[0], h_parents[1]);
139
void au_hdir_unlock_rename(struct dentry **h_parents, struct inode **dirs,
140
aufs_bindex_t bindex, int issamedir)
142
vfsub_unlock_rename(h_parents[0], h_parents[1]);
145
125
static inline void au_reset_hinotify(struct inode *inode, unsigned int flags)
150
static inline void au_hin_ignore(struct au_hinotify *hinotify, __u32 events)
155
static inline void au_hin_unignore(struct au_hinotify *hinotify, __u32 events)
160
130
static inline int au_inotify_init(void)
165
135
#define au_inotify_fin() do {} while (0)
137
static inline void au_hin_suspend(struct au_hinode *hinode)
142
static inline void au_hin_resume(struct au_hinode *hinode)
166
146
#endif /* CONFIG_AUFS_HINOTIFY */
168
/* ---------------------------------------------------------------------- */
171
* au_hdir_lock, au_hdir2_lock
173
#define AuLockFunc(name, lsc) \
175
void name##_lock(struct inode *h_dir, struct inode *dir, aufs_bindex_t bindex) \
176
{ au_do_hdir_lock(h_dir, dir, bindex, AuLsc_I_##lsc); }
178
AuLockFunc(au_hdir, PARENT);
179
AuLockFunc(au_hdir2, PARENT2);
148
#if defined(CONFIG_AUFS_HINOTIFY) && defined(CONFIG_AUFS_DEBUG)
149
static inline void au_hin_list_del(struct list_head *e)
154
void au_dbg_hin_list(struct vfsub_args *vargs);
156
static inline void au_hin_list_del(struct list_head *e)
161
static inline void au_dbg_hin_list(struct vfsub_args *vargs)
165
#endif /* CONFIG_AUFS_DEBUG */
183
167
/* ---------------------------------------------------------------------- */