30
30
#include <linux/fs.h>
31
31
#include <linux/aufs_type.h>
33
int au_alloc_whname(const char *name, int len, struct qstr *wh);
34
void au_free_whname(struct qstr *wh);
37
int au_test_wh(struct dentry *h_parent, struct qstr *wh_name, int try_sio,
38
struct aufs_ndx *ndx);
39
int au_test_diropq(struct dentry *h_dentry, struct aufs_ndx *ndx);
41
struct dentry *lkup_whtmp(struct dentry *h_parent, struct qstr *prefix,
42
struct aufs_ndx *ndx);
43
int rename_whtmp(struct inode *dir, struct dentry *dentry, aufs_bindex_t bindex,
33
int au_wh_name_alloc(const char *name, int len, struct qstr *wh);
34
void au_wh_name_free(struct qstr *wh);
37
int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio,
39
int au_diropq_test(struct dentry *h_dentry, struct au_ndx *ndx);
41
struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct qstr *prefix,
43
int au_whtmp_ren(struct inode *dir, struct dentry *dentry, aufs_bindex_t bindex,
45
int au_unlink_wh_dentry(struct inode *h_dir, struct dentry *wh_dentry,
45
int au_wh_unlink_dentry(struct inode *h_dir, struct dentry *wh_dentry,
46
46
struct dentry *dentry, struct inode *dir, int dlgt);
49
int init_wh(struct dentry *h_parent, struct aufs_branch *br,
50
struct vfsmount *nfsmnt, struct super_block *sb);
49
int au_wh_init(struct dentry *h_parent, struct au_branch *br,
50
struct vfsmount *nfsmnt, struct super_block *sb);
53
53
#define AuDiropq_CREATE 1
55
55
#define au_ftest_diropq(flags, name) ((flags) & AuDiropq_##name)
56
56
#define au_fset_diropq(flags, name) { (flags) |= AuDiropq_##name; }
57
57
#define au_fclr_diropq(flags, name) { (flags) &= ~AuDiropq_##name; }
59
struct dentry *sio_diropq(struct dentry *dentry, aufs_bindex_t bindex,
62
struct dentry *lkup_wh(struct dentry *h_parent, struct qstr *base_name,
63
struct aufs_ndx *ndx);
64
struct dentry *simple_create_wh(struct inode *dir, struct dentry *dentry,
65
aufs_bindex_t bindex, struct dentry *h_parent,
66
struct aufs_ndx *ndx);
58
#ifndef CONFIG_AUFS_DLGT
60
#define AuDiropq_DLGT 0
63
struct dentry *au_diropq_sio(struct dentry *dentry, aufs_bindex_t bindex,
66
struct dentry *au_wh_lkup(struct dentry *h_parent, struct qstr *base_name,
68
struct dentry *au_wh_create(struct inode *dir, struct dentry *dentry,
69
aufs_bindex_t bindex, struct dentry *h_parent,
68
72
/* real rmdir the whiteout-ed dir */
69
struct rmdir_whtmp_args {
73
struct au_whtmp_rmdir_args {
70
74
struct dentry *h_dentry;
71
struct aufs_nhash whlist;
75
struct au_nhash whlist;
72
76
aufs_bindex_t bindex;
73
77
struct inode *dir, *inode;
78
int rmdir_whtmp(struct dentry *h_dentry, struct aufs_nhash *whlist,
79
aufs_bindex_t bindex, struct inode *dir, struct inode *inode,
81
void kick_rmdir_whtmp(struct dentry *h_dentry, struct aufs_nhash *whlist,
82
aufs_bindex_t bindex, struct inode *dir,
83
struct inode *inode, int noself,
84
struct rmdir_whtmp_args *args);
82
int au_whtmp_rmdir(struct dentry *h_dentry, struct au_nhash *whlist,
83
aufs_bindex_t bindex, struct inode *dir, struct inode *inode,
85
void au_whtmp_kick_rmdir(struct dentry *h_dentry, struct au_nhash *whlist,
86
aufs_bindex_t bindex, struct inode *dir,
87
struct inode *inode, int noself,
88
struct au_whtmp_rmdir_args *args);
86
90
/* ---------------------------------------------------------------------- */
89
struct dentry *create_diropq(struct dentry *dentry, aufs_bindex_t bindex,
93
struct dentry *au_diropq_create(struct dentry *dentry, aufs_bindex_t bindex,
92
96
unsigned int flags = AuDiropq_CREATE;
93
97
if (unlikely(dlgt))
94
98
au_fset_diropq(flags, DLGT);
95
return sio_diropq(dentry, bindex, flags);
99
return au_diropq_sio(dentry, bindex, flags);
99
int remove_diropq(struct dentry *dentry, aufs_bindex_t bindex, int dlgt)
103
int au_diropq_remove(struct dentry *dentry, aufs_bindex_t bindex, int dlgt)
101
105
unsigned int flags = !AuDiropq_CREATE;
102
106
if (unlikely(dlgt))
103
107
au_fset_diropq(flags, DLGT);
104
return PTR_ERR(sio_diropq(dentry, bindex, flags));
108
return PTR_ERR(au_diropq_sio(dentry, bindex, flags));
111
/* ---------------------------------------------------------------------- */
113
#ifdef CONFIG_AUFS_ROBR
115
int au_test_robr_wh(struct qstr *name, struct dentry *h_parent,
116
struct qstr *wh_name, int try_sio, struct au_ndx *ndx);
117
int au_test_robr_shwh(struct super_block *sb, const struct qstr *name);
120
int au_test_robr_wh(struct qstr *name, struct dentry *h_parent,
121
struct qstr *wh_name, int try_sio, struct au_ndx *ndx)
123
return au_wh_test(h_parent, wh_name, try_sio, ndx);
127
int au_test_robr_shwh(struct super_block *sb, const struct qstr *name)
129
if (unlikely(!au_opt_test(au_mntflags(sb), SHWH)
130
&& !strncmp(name->name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)))
134
#endif /* CONFIG_AUFS_ROBR */
107
136
#endif /* __KERNEL__ */
108
137
#endif /* __AUFS_WHOUT_H__ */