~ubuntu-branches/ubuntu/vivid/aufs/vivid

« back to all changes in this revision

Viewing changes to fs/aufs/whout.h

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-05-06 18:35:50 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080506183550-0b6c974kkgc46oeh
Tags: 0+20080506-1
* New upstream release, supports Kernel 2.6.25 (Closes: #479717)
* Fix building with older Kernels (Closes: #475042)
* Update the patches 01, 04 and 07 to also patch fs/aufs25

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
/*
20
20
 * whiteout for logical deletion and opaque directory
21
21
 *
22
 
 * $Id: whout.h,v 1.16 2008/03/31 07:45:32 sfjro Exp $
 
22
 * $Id: whout.h,v 1.17 2008/04/13 23:46:44 sfjro Exp $
23
23
 */
24
24
 
25
25
#ifndef __AUFS_WHOUT_H__
30
30
#include <linux/fs.h>
31
31
#include <linux/aufs_type.h>
32
32
 
33
 
int au_alloc_whname(const char *name, int len, struct qstr *wh);
34
 
void au_free_whname(struct qstr *wh);
35
 
 
36
 
struct aufs_ndx;
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);
40
 
 
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);
 
35
 
 
36
struct au_ndx;
 
37
int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio,
 
38
               struct au_ndx *ndx);
 
39
int au_diropq_test(struct dentry *h_dentry, struct au_ndx *ndx);
 
40
 
 
41
struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct qstr *prefix,
 
42
                             struct au_ndx *ndx);
 
43
int au_whtmp_ren(struct inode *dir, struct dentry *dentry, aufs_bindex_t bindex,
44
44
                 int noself);
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);
47
47
 
48
 
struct aufs_branch;
49
 
int init_wh(struct dentry *h_parent, struct aufs_branch *br,
50
 
            struct vfsmount *nfsmnt, struct super_block *sb);
 
48
struct au_branch;
 
49
int au_wh_init(struct dentry *h_parent, struct au_branch *br,
 
50
               struct vfsmount *nfsmnt, struct super_block *sb);
51
51
 
52
52
/* diropq flags */
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; }
58
 
 
59
 
struct dentry *sio_diropq(struct dentry *dentry, aufs_bindex_t bindex,
60
 
                          unsigned int flags);
61
 
 
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
 
59
#undef AuDiropq_DLGT
 
60
#define AuDiropq_DLGT   0
 
61
#endif
 
62
 
 
63
struct dentry *au_diropq_sio(struct dentry *dentry, aufs_bindex_t bindex,
 
64
                             unsigned int flags);
 
65
 
 
66
struct dentry *au_wh_lkup(struct dentry *h_parent, struct qstr *base_name,
 
67
                          struct au_ndx *ndx);
 
68
struct dentry *au_wh_create(struct inode *dir, struct dentry *dentry,
 
69
                            aufs_bindex_t bindex, struct dentry *h_parent,
 
70
                            struct au_ndx *ndx);
67
71
 
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;
74
78
        int noself;
75
79
};
76
80
 
77
 
struct aufs_nhash;
78
 
int rmdir_whtmp(struct dentry *h_dentry, struct aufs_nhash *whlist,
79
 
                aufs_bindex_t bindex, struct inode *dir, struct inode *inode,
80
 
                int noself);
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);
 
81
struct au_nhash;
 
82
int au_whtmp_rmdir(struct dentry *h_dentry, struct au_nhash *whlist,
 
83
                   aufs_bindex_t bindex, struct inode *dir, struct inode *inode,
 
84
                   int noself);
 
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);
85
89
 
86
90
/* ---------------------------------------------------------------------- */
87
91
 
88
92
static inline
89
 
struct dentry *create_diropq(struct dentry *dentry, aufs_bindex_t bindex,
90
 
                             int dlgt)
 
93
struct dentry *au_diropq_create(struct dentry *dentry, aufs_bindex_t bindex,
 
94
                                int dlgt)
91
95
{
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);
96
100
}
97
101
 
98
102
static inline
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)
100
104
{
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));
105
 
}
 
108
        return PTR_ERR(au_diropq_sio(dentry, bindex, flags));
 
109
}
 
110
 
 
111
/* ---------------------------------------------------------------------- */
 
112
 
 
113
#ifdef CONFIG_AUFS_ROBR
 
114
/* robr.c */
 
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);
 
118
#else
 
119
static inline
 
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)
 
122
{
 
123
        return au_wh_test(h_parent, wh_name, try_sio, ndx);
 
124
}
 
125
 
 
126
static inline
 
127
int au_test_robr_shwh(struct super_block *sb, const struct qstr *name)
 
128
{
 
129
        if (unlikely(!au_opt_test(au_mntflags(sb), SHWH)
 
130
                     && !strncmp(name->name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)))
 
131
                return -EPERM;
 
132
        return 0;
 
133
}
 
134
#endif /* CONFIG_AUFS_ROBR */
106
135
 
107
136
#endif /* __KERNEL__ */
108
137
#endif /* __AUFS_WHOUT_H__ */