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

« back to all changes in this revision

Viewing changes to fs/aufs/opts.h

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2007-12-15 23:32:51 UTC
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20071215233251-1emj2gj6sz0osjlr
Tags: upstream-0+20071211
ImportĀ upstreamĀ versionĀ 0+20071211

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
 */
18
18
 
19
 
/* $Id: opts.h,v 1.13 2007/05/14 06:27:18 sfjro Exp $ */
 
19
/* $Id: opts.h,v 1.25 2007/12/10 01:19:34 sfjro Exp $ */
20
20
 
21
21
#ifndef __AUFS_OPTS_H__
22
22
#define __AUFS_OPTS_H__
28
28
#include <linux/version.h>
29
29
#include <linux/aufs_type.h>
30
30
 
31
 
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
32
 
typedef const char* au_parser_pattern_t;
 
31
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
 
32
typedef const char *au_parser_pattern_t;
33
33
#else
34
 
typedef char* au_parser_pattern_t;
 
34
typedef char *au_parser_pattern_t;
35
35
#endif
36
36
 
37
37
/* ---------------------------------------------------------------------- */
38
 
 
39
 
struct opt_add {
 
38
/* mount flags */
 
39
 
 
40
/* external inode number bitmap and translation table */
 
41
enum {
 
42
        AuXino_NONE,
 
43
        AuXino_XINO,
 
44
        AuXino_XIB
 
45
};
 
46
 
 
47
/* users direct branch access */
 
48
enum {
 
49
        AuUdba_NONE,
 
50
        AuUdba_REVAL,
 
51
        AuUdba_INOTIFY
 
52
};
 
53
 
 
54
/* copyup on open */
 
55
enum {
 
56
        AuCoo_NONE,
 
57
        AuCoo_LEAF,
 
58
        AuCoo_ALL
 
59
};
 
60
 
 
61
/* policies to select one among multiple writable branches */
 
62
enum {
 
63
        AuWbrCreate_TDP,        /* top down parent */
 
64
        AuWbrCreate_RR,         /* round robin */
 
65
        AuWbrCreate_MFS,        /* most free space */
 
66
        AuWbrCreate_MFSV,       /* mfs with seconds */
 
67
        AuWbrCreate_MFSRR,      /* mfs then rr */
 
68
        AuWbrCreate_MFSRRV,     /* mfs then rr with seconds */
 
69
        AuWbrCreate_PMFS,       /* parent and mfs */
 
70
        AuWbrCreate_PMFSV,      /* parent and mfs with seconds */
 
71
        AuWbrCreate_Last
 
72
};
 
73
 
 
74
enum {
 
75
        AuWbrCopyup_TDP,        /* top down parent */
 
76
        AuWbrCopyup_BUP,        /* bottom up parent */
 
77
        AuWbrCopyup_BU          /* bottom up */
 
78
};
 
79
 
 
80
/* revert it to bit-shift? */
 
81
struct au_opts_flags {
 
82
        unsigned int    f_xino:2;
 
83
        unsigned int    f_trunc_xino:1;
 
84
        unsigned int    f_udba:2;
 
85
        unsigned int    f_dlgt:1;
 
86
        unsigned int    f_plink:1;
 
87
        unsigned int    f_warn_perm:1;
 
88
        unsigned int    f_coo:2;
 
89
        unsigned int    f_always_diropq:1;
 
90
        unsigned int    f_refrof:1;
 
91
        unsigned int    f_verbose:1;
 
92
        unsigned int    f_wbr_copyup:2;
 
93
        unsigned int    f_wbr_create:3;
 
94
};
 
95
 
 
96
/* ---------------------------------------------------------------------- */
 
97
 
 
98
struct au_opt_add {
40
99
        aufs_bindex_t           bindex;
41
100
        char                    *path;
42
101
        int                     perm;
43
102
        struct nameidata        nd;
44
103
};
45
104
 
46
 
struct opt_del {
 
105
struct au_opt_del {
47
106
        char            *path;
48
107
        struct dentry   *h_root;
49
108
};
50
109
 
51
 
struct opt_mod {
 
110
struct au_opt_mod {
52
111
        char            *path;
53
112
        int             perm;
54
113
        struct dentry   *h_root;
55
114
};
56
115
 
57
 
struct opt_xino {
 
116
struct au_opt_xino {
58
117
        char            *path;
59
118
        struct file     *file;
60
119
};
61
120
 
62
 
struct opt {
 
121
struct au_opt_xino_itrunc {
 
122
        aufs_bindex_t   bindex;
 
123
};
 
124
 
 
125
struct au_opt_xino_trunc_v {
 
126
        u64             upper;
 
127
        int             step;
 
128
};
 
129
 
 
130
struct au_opt_wbr_create {
 
131
        int wbr_create;
 
132
        int mfs_second;
 
133
        u64 mfsrr_watermark;
 
134
};
 
135
 
 
136
struct au_opt {
63
137
        int type;
64
138
        union {
65
 
                struct opt_xino xino;
66
 
                struct opt_add  add;
67
 
                struct opt_del  del;
68
 
                struct opt_mod  mod;
69
 
                int             dirwh;
70
 
                int             rdcache;
71
 
                int             deblk;
72
 
                int             nhash;
73
 
                int             udba;
74
 
                int             coo;
 
139
                struct au_opt_xino      xino;
 
140
                struct au_opt_xino_itrunc xino_itrunc;
 
141
                struct au_opt_add       add;
 
142
                struct au_opt_del       del;
 
143
                struct au_opt_mod       mod;
 
144
                int                     dirwh;
 
145
                int                     rdcache;
 
146
                int                     deblk;
 
147
                int                     nhash;
 
148
                int                     udba;
 
149
                int                     coo;
 
150
                struct au_opt_wbr_create wbr_create;
 
151
                int                     wbr_copyup;
75
152
        };
76
153
};
77
154
 
78
 
struct opts {
79
 
        struct opt      *opt;
 
155
struct au_opts {
 
156
        struct au_opt   *opt;
80
157
        int             max_opt;
 
158
 
 
159
        struct au_opts_flags given;
 
160
        struct {
 
161
                unsigned int remount:1;
 
162
 
 
163
                unsigned int refresh_dir:1;
 
164
                unsigned int refresh_nondir:1;
 
165
                unsigned int trunc_xib:1;
 
166
        };
81
167
};
82
168
 
83
169
/* ---------------------------------------------------------------------- */
84
170
 
85
 
int br_perm_str(char *p, unsigned int len, int brperm);
86
 
au_parser_pattern_t udba_str(int udba);
87
 
void udba_set(struct super_block *sb, unsigned int flg);
88
 
//au_parser_pattern_t coo_str(int coo);
89
 
void au_free_opts(struct opts *opts);
90
 
int au_parse_opts(struct super_block *sb, char *str, struct opts *opts);
91
 
int au_do_opts_mount(struct super_block *sb, struct opts *opts);
92
 
int au_do_opts_remount(struct super_block *sb, struct opts *opts,
93
 
                       int *do_refresh, unsigned int *given);
 
171
void au_opts_flags_def(struct au_opts_flags *flags);
 
172
au_parser_pattern_t au_optstr_br_perm(int brperm);
 
173
au_parser_pattern_t au_optstr_udba(int udba);
 
174
au_parser_pattern_t au_optstr_coo(int coo);
 
175
au_parser_pattern_t au_optstr_wbr_copyup(int wbr_copyup);
 
176
au_parser_pattern_t au_optstr_wbr_create(int wbr_create);
 
177
 
 
178
void au_opts_free(struct au_opts *opts);
 
179
int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts);
 
180
int au_opts_mount(struct super_block *sb, struct au_opts *opts);
 
181
int au_opts_remount(struct super_block *sb, struct au_opts *opts);
94
182
 
95
183
#endif /* __KERNEL__ */
96
184
#endif /* __AUFS_OPTS_H__ */