xref: /OK3568_Linux_fs/kernel/include/uapi/linux/mount.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun #ifndef _UAPI_LINUX_MOUNT_H
2*4882a593Smuzhiyun #define _UAPI_LINUX_MOUNT_H
3*4882a593Smuzhiyun 
4*4882a593Smuzhiyun /*
5*4882a593Smuzhiyun  * These are the fs-independent mount-flags: up to 32 flags are supported
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Usage of these is restricted within the kernel to core mount(2) code and
8*4882a593Smuzhiyun  * callers of sys_mount() only.  Filesystems should be using the SB_*
9*4882a593Smuzhiyun  * equivalent instead.
10*4882a593Smuzhiyun  */
11*4882a593Smuzhiyun #define MS_RDONLY	 1	/* Mount read-only */
12*4882a593Smuzhiyun #define MS_NOSUID	 2	/* Ignore suid and sgid bits */
13*4882a593Smuzhiyun #define MS_NODEV	 4	/* Disallow access to device special files */
14*4882a593Smuzhiyun #define MS_NOEXEC	 8	/* Disallow program execution */
15*4882a593Smuzhiyun #define MS_SYNCHRONOUS	16	/* Writes are synced at once */
16*4882a593Smuzhiyun #define MS_REMOUNT	32	/* Alter flags of a mounted FS */
17*4882a593Smuzhiyun #define MS_MANDLOCK	64	/* Allow mandatory locks on an FS */
18*4882a593Smuzhiyun #define MS_DIRSYNC	128	/* Directory modifications are synchronous */
19*4882a593Smuzhiyun #define MS_NOSYMFOLLOW	256	/* Do not follow symlinks */
20*4882a593Smuzhiyun #define MS_NOATIME	1024	/* Do not update access times. */
21*4882a593Smuzhiyun #define MS_NODIRATIME	2048	/* Do not update directory access times */
22*4882a593Smuzhiyun #define MS_BIND		4096
23*4882a593Smuzhiyun #define MS_MOVE		8192
24*4882a593Smuzhiyun #define MS_REC		16384
25*4882a593Smuzhiyun #define MS_VERBOSE	32768	/* War is peace. Verbosity is silence.
26*4882a593Smuzhiyun 				   MS_VERBOSE is deprecated. */
27*4882a593Smuzhiyun #define MS_SILENT	32768
28*4882a593Smuzhiyun #define MS_POSIXACL	(1<<16)	/* VFS does not apply the umask */
29*4882a593Smuzhiyun #define MS_UNBINDABLE	(1<<17)	/* change to unbindable */
30*4882a593Smuzhiyun #define MS_PRIVATE	(1<<18)	/* change to private */
31*4882a593Smuzhiyun #define MS_SLAVE	(1<<19)	/* change to slave */
32*4882a593Smuzhiyun #define MS_SHARED	(1<<20)	/* change to shared */
33*4882a593Smuzhiyun #define MS_RELATIME	(1<<21)	/* Update atime relative to mtime/ctime. */
34*4882a593Smuzhiyun #define MS_KERNMOUNT	(1<<22) /* this is a kern_mount call */
35*4882a593Smuzhiyun #define MS_I_VERSION	(1<<23) /* Update inode I_version field */
36*4882a593Smuzhiyun #define MS_STRICTATIME	(1<<24) /* Always perform atime updates */
37*4882a593Smuzhiyun #define MS_LAZYTIME	(1<<25) /* Update the on-disk [acm]times lazily */
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun /* These sb flags are internal to the kernel */
40*4882a593Smuzhiyun #define MS_SUBMOUNT     (1<<26)
41*4882a593Smuzhiyun #define MS_NOREMOTELOCK	(1<<27)
42*4882a593Smuzhiyun #define MS_NOSEC	(1<<28)
43*4882a593Smuzhiyun #define MS_BORN		(1<<29)
44*4882a593Smuzhiyun #define MS_ACTIVE	(1<<30)
45*4882a593Smuzhiyun #define MS_NOUSER	(1<<31)
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun /*
48*4882a593Smuzhiyun  * Superblock flags that can be altered by MS_REMOUNT
49*4882a593Smuzhiyun  */
50*4882a593Smuzhiyun #define MS_RMT_MASK	(MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION|\
51*4882a593Smuzhiyun 			 MS_LAZYTIME)
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun /*
54*4882a593Smuzhiyun  * Old magic mount flag and mask
55*4882a593Smuzhiyun  */
56*4882a593Smuzhiyun #define MS_MGC_VAL 0xC0ED0000
57*4882a593Smuzhiyun #define MS_MGC_MSK 0xffff0000
58*4882a593Smuzhiyun 
59*4882a593Smuzhiyun /*
60*4882a593Smuzhiyun  * open_tree() flags.
61*4882a593Smuzhiyun  */
62*4882a593Smuzhiyun #define OPEN_TREE_CLONE		1		/* Clone the target tree and attach the clone */
63*4882a593Smuzhiyun #define OPEN_TREE_CLOEXEC	O_CLOEXEC	/* Close the file on execve() */
64*4882a593Smuzhiyun 
65*4882a593Smuzhiyun /*
66*4882a593Smuzhiyun  * move_mount() flags.
67*4882a593Smuzhiyun  */
68*4882a593Smuzhiyun #define MOVE_MOUNT_F_SYMLINKS		0x00000001 /* Follow symlinks on from path */
69*4882a593Smuzhiyun #define MOVE_MOUNT_F_AUTOMOUNTS		0x00000002 /* Follow automounts on from path */
70*4882a593Smuzhiyun #define MOVE_MOUNT_F_EMPTY_PATH		0x00000004 /* Empty from path permitted */
71*4882a593Smuzhiyun #define MOVE_MOUNT_T_SYMLINKS		0x00000010 /* Follow symlinks on to path */
72*4882a593Smuzhiyun #define MOVE_MOUNT_T_AUTOMOUNTS		0x00000020 /* Follow automounts on to path */
73*4882a593Smuzhiyun #define MOVE_MOUNT_T_EMPTY_PATH		0x00000040 /* Empty to path permitted */
74*4882a593Smuzhiyun #define MOVE_MOUNT__MASK		0x00000077
75*4882a593Smuzhiyun 
76*4882a593Smuzhiyun /*
77*4882a593Smuzhiyun  * fsopen() flags.
78*4882a593Smuzhiyun  */
79*4882a593Smuzhiyun #define FSOPEN_CLOEXEC		0x00000001
80*4882a593Smuzhiyun 
81*4882a593Smuzhiyun /*
82*4882a593Smuzhiyun  * fspick() flags.
83*4882a593Smuzhiyun  */
84*4882a593Smuzhiyun #define FSPICK_CLOEXEC		0x00000001
85*4882a593Smuzhiyun #define FSPICK_SYMLINK_NOFOLLOW	0x00000002
86*4882a593Smuzhiyun #define FSPICK_NO_AUTOMOUNT	0x00000004
87*4882a593Smuzhiyun #define FSPICK_EMPTY_PATH	0x00000008
88*4882a593Smuzhiyun 
89*4882a593Smuzhiyun /*
90*4882a593Smuzhiyun  * The type of fsconfig() call made.
91*4882a593Smuzhiyun  */
92*4882a593Smuzhiyun enum fsconfig_command {
93*4882a593Smuzhiyun 	FSCONFIG_SET_FLAG	= 0,	/* Set parameter, supplying no value */
94*4882a593Smuzhiyun 	FSCONFIG_SET_STRING	= 1,	/* Set parameter, supplying a string value */
95*4882a593Smuzhiyun 	FSCONFIG_SET_BINARY	= 2,	/* Set parameter, supplying a binary blob value */
96*4882a593Smuzhiyun 	FSCONFIG_SET_PATH	= 3,	/* Set parameter, supplying an object by path */
97*4882a593Smuzhiyun 	FSCONFIG_SET_PATH_EMPTY	= 4,	/* Set parameter, supplying an object by (empty) path */
98*4882a593Smuzhiyun 	FSCONFIG_SET_FD		= 5,	/* Set parameter, supplying an object by fd */
99*4882a593Smuzhiyun 	FSCONFIG_CMD_CREATE	= 6,	/* Invoke superblock creation */
100*4882a593Smuzhiyun 	FSCONFIG_CMD_RECONFIGURE = 7,	/* Invoke superblock reconfiguration */
101*4882a593Smuzhiyun };
102*4882a593Smuzhiyun 
103*4882a593Smuzhiyun /*
104*4882a593Smuzhiyun  * fsmount() flags.
105*4882a593Smuzhiyun  */
106*4882a593Smuzhiyun #define FSMOUNT_CLOEXEC		0x00000001
107*4882a593Smuzhiyun 
108*4882a593Smuzhiyun /*
109*4882a593Smuzhiyun  * Mount attributes.
110*4882a593Smuzhiyun  */
111*4882a593Smuzhiyun #define MOUNT_ATTR_RDONLY	0x00000001 /* Mount read-only */
112*4882a593Smuzhiyun #define MOUNT_ATTR_NOSUID	0x00000002 /* Ignore suid and sgid bits */
113*4882a593Smuzhiyun #define MOUNT_ATTR_NODEV	0x00000004 /* Disallow access to device special files */
114*4882a593Smuzhiyun #define MOUNT_ATTR_NOEXEC	0x00000008 /* Disallow program execution */
115*4882a593Smuzhiyun #define MOUNT_ATTR__ATIME	0x00000070 /* Setting on how atime should be updated */
116*4882a593Smuzhiyun #define MOUNT_ATTR_RELATIME	0x00000000 /* - Update atime relative to mtime/ctime. */
117*4882a593Smuzhiyun #define MOUNT_ATTR_NOATIME	0x00000010 /* - Do not update access times. */
118*4882a593Smuzhiyun #define MOUNT_ATTR_STRICTATIME	0x00000020 /* - Always perform atime updates */
119*4882a593Smuzhiyun #define MOUNT_ATTR_NODIRATIME	0x00000080 /* Do not update directory access times */
120*4882a593Smuzhiyun 
121*4882a593Smuzhiyun #endif /* _UAPI_LINUX_MOUNT_H */
122