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