opts.h 1.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2005-2019 Junjiro R. Okajima
 */

/*
 * mount options/flags
 */

#ifndef __AUFS_OPTS_H__
#define __AUFS_OPTS_H__

#ifdef __KERNEL__

#include <linux/path.h>

J. R. Okajima's avatar
J. R. Okajima committed
17
18
struct file;

J. R. Okajima's avatar
J. R. Okajima committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* ---------------------------------------------------------------------- */

/* mount flags */
#define AuOpt_XINO		1		/* external inode number bitmap
						   and translation table */

#define AuOpt_Def	AuOpt_XINO

#define au_opt_test(flags, name)	(flags & AuOpt_##name)
#define au_opt_set(flags, name) do { \
	((flags) |= AuOpt_##name); \
} while (0)
#define au_opt_clr(flags, name) do { \
	((flags) &= ~AuOpt_##name); \
} while (0)

/* ---------------------------------------------------------------------- */

37
38
39
40
41
42
43
struct au_opt_add {
	aufs_bindex_t	bindex;
	char		*pathname;
	int		perm;
	struct path	path;
};

J. R. Okajima's avatar
J. R. Okajima committed
44
45
46
47
48
struct au_opt_xino {
	char		*path;
	struct file	*file;
};

49
50
51
struct au_opt {
	int type;
	union {
J. R. Okajima's avatar
J. R. Okajima committed
52
		struct au_opt_xino	xino;
53
54
55
56
57
58
59
60
		struct au_opt_add	add;
		/* add more later */
	};
};

struct au_opts {
	struct au_opt	*opt;
	int		max_opt;
61
62

	unsigned long	sb_flags;
63
64
};

65
66
67
68
69
70
71
72
73
74
/* ---------------------------------------------------------------------- */

/* opts.c */
void au_optstr_br_perm(au_br_perm_str_t *str, int perm);

void au_opts_free(struct au_opts *opts);
struct super_block;
int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts);
int au_opts_mount(struct super_block *sb, struct au_opts *opts);

75
76
#endif /* __KERNEL__ */
#endif /* __AUFS_OPTS_H__ */