28
28
#include <linux/fs.h>
29
#include <linux/inotify.h>
29
#include <linux/fsnotify.h>
30
30
#include <linux/aufs_type.h>
36
#ifdef CONFIG_AUFS_HINOTIFY
37
struct inotify_watch hin_watch;
38
struct inode *hin_aufs_inode; /* no get/put */
36
#ifdef CONFIG_AUFS_HNOTIFY
37
#ifdef CONFIG_AUFS_HFSNOTIFY
38
struct fsnotify_mark_entry hn_entry;
40
struct inotify_watch hn_watch;
42
struct inode *hn_aufs_inode; /* no get/put */
43
47
struct inode *hi_inode;
44
48
aufs_bindex_t hi_id;
45
#ifdef CONFIG_AUFS_HINOTIFY
46
struct au_hinotify *hi_notify;
49
#ifdef CONFIG_AUFS_HNOTIFY
50
struct au_hnotify *hi_notify;
49
53
/* reference to the copied-up whiteout with get/put */
402
411
/* ---------------------------------------------------------------------- */
404
#ifdef CONFIG_AUFS_HINOTIFY
413
#ifdef CONFIG_AUFS_HNOTIFY
414
struct au_hnotify_op {
415
void (*ctl)(struct au_hinode *hinode, int do_set);
416
int (*alloc)(struct au_hnotify *hn, struct inode *h_inode);
417
void (*free)(struct au_hnotify *hn);
424
int au_hn_alloc(struct au_hinode *hinode, struct inode *inode,
425
struct inode *h_inode);
426
void au_hn_free(struct au_hinode *hinode);
427
void au_hn_ctl(struct au_hinode *hinode, int do_set);
428
void au_hn_reset(struct inode *inode, unsigned int flags);
429
int au_hnotify(struct inode *h_dir, struct au_hnotify *hnotify, u32 mask,
430
struct qstr *h_child_qstr, struct inode *h_child_inode);
431
int __init au_hnotify_init(void);
432
void au_hnotify_fin(void);
406
int au_hin_alloc(struct au_hinode *hinode, struct inode *inode,
407
struct inode *h_inode);
408
void au_hin_free(struct au_hinode *hinode);
409
void au_hin_ctl(struct au_hinode *hinode, int do_set);
410
void au_reset_hinotify(struct inode *inode, unsigned int flags);
412
int __init au_hinotify_init(void);
413
void au_hinotify_fin(void);
435
extern const struct au_hnotify_op au_hnotify_op;
416
void au_hin_init(struct au_hinode *hinode, struct au_hinotify *val)
418
hinode->hi_notify = val;
421
static inline void au_iigen_dec(struct inode *inode)
423
atomic_dec_return(&au_ii(inode)->ii_generation);
438
void au_hn_init(struct au_hinode *hinode)
440
hinode->hi_notify = NULL;
428
int au_hin_alloc(struct au_hinode *hinode __maybe_unused,
429
struct inode *inode __maybe_unused,
430
struct inode *h_inode __maybe_unused)
445
int au_hn_alloc(struct au_hinode *hinode __maybe_unused,
446
struct inode *inode __maybe_unused,
447
struct inode *h_inode __maybe_unused)
432
449
return -EOPNOTSUPP;
435
static inline void au_hin_free(struct au_hinode *hinode __maybe_unused)
440
static inline void au_hin_ctl(struct au_hinode *hinode __maybe_unused,
441
int do_set __maybe_unused)
446
static inline void au_reset_hinotify(struct inode *inode __maybe_unused,
447
unsigned int flags __maybe_unused)
452
static inline int au_hinotify_init(void)
457
#define au_hinotify_fin() do {} while (0)
460
void au_hin_init(struct au_hinode *hinode __maybe_unused,
461
struct au_hinotify *val __maybe_unused)
465
#endif /* CONFIG_AUFS_HINOTIFY */
467
static inline void au_hin_suspend(struct au_hinode *hdir)
469
au_hin_ctl(hdir, /*do_set*/0);
472
static inline void au_hin_resume(struct au_hinode *hdir)
474
au_hin_ctl(hdir, /*do_set*/1);
477
static inline void au_hin_imtx_lock(struct au_hinode *hdir)
452
AuStubVoid(au_hn_free, struct au_hinode *hinode __maybe_unused)
453
AuStubVoid(au_hn_ctl, struct au_hinode *hinode __maybe_unused,
454
int do_set __maybe_unused)
455
AuStubVoid(au_hn_reset, struct inode *inode __maybe_unused,
456
unsigned int flags __maybe_unused)
457
AuStubInt0(__init au_hnotify_init, void)
458
AuStubVoid(au_hnotify_fin, void)
459
AuStubVoid(au_hn_init, struct au_hinode *hinode __maybe_unused)
460
#endif /* CONFIG_AUFS_HNOTIFY */
462
static inline void au_hn_suspend(struct au_hinode *hdir)
464
au_hn_ctl(hdir, /*do_set*/0);
467
static inline void au_hn_resume(struct au_hinode *hdir)
469
au_hn_ctl(hdir, /*do_set*/1);
472
static inline void au_hn_imtx_lock(struct au_hinode *hdir)
479
474
mutex_lock(&hdir->hi_inode->i_mutex);
480
au_hin_suspend(hdir);
483
static inline void au_hin_imtx_lock_nested(struct au_hinode *hdir,
484
unsigned int sc __maybe_unused)
478
static inline void au_hn_imtx_lock_nested(struct au_hinode *hdir,
479
unsigned int sc __maybe_unused)
486
481
mutex_lock_nested(&hdir->hi_inode->i_mutex, sc);
487
au_hin_suspend(hdir);
490
static inline void au_hin_imtx_unlock(struct au_hinode *hdir)
485
static inline void au_hn_imtx_unlock(struct au_hinode *hdir)
493
488
mutex_unlock(&hdir->hi_inode->i_mutex);