1e262e32dSDavid Howells #ifndef _UAPI_LINUX_MOUNT_H 2e262e32dSDavid Howells #define _UAPI_LINUX_MOUNT_H 3e262e32dSDavid Howells 42a186721SChristian Brauner #include <linux/types.h> 52a186721SChristian Brauner 6e262e32dSDavid Howells /* 7e262e32dSDavid Howells * These are the fs-independent mount-flags: up to 32 flags are supported 8e262e32dSDavid Howells * 9e262e32dSDavid Howells * Usage of these is restricted within the kernel to core mount(2) code and 10e262e32dSDavid Howells * callers of sys_mount() only. Filesystems should be using the SB_* 11e262e32dSDavid Howells * equivalent instead. 12e262e32dSDavid Howells */ 13e262e32dSDavid Howells #define MS_RDONLY 1 /* Mount read-only */ 14e262e32dSDavid Howells #define MS_NOSUID 2 /* Ignore suid and sgid bits */ 15e262e32dSDavid Howells #define MS_NODEV 4 /* Disallow access to device special files */ 16e262e32dSDavid Howells #define MS_NOEXEC 8 /* Disallow program execution */ 17e262e32dSDavid Howells #define MS_SYNCHRONOUS 16 /* Writes are synced at once */ 18e262e32dSDavid Howells #define MS_REMOUNT 32 /* Alter flags of a mounted FS */ 19e262e32dSDavid Howells #define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */ 20e262e32dSDavid Howells #define MS_DIRSYNC 128 /* Directory modifications are synchronous */ 21dab741e0SMattias Nissler #define MS_NOSYMFOLLOW 256 /* Do not follow symlinks */ 22e262e32dSDavid Howells #define MS_NOATIME 1024 /* Do not update access times. */ 23e262e32dSDavid Howells #define MS_NODIRATIME 2048 /* Do not update directory access times */ 24e262e32dSDavid Howells #define MS_BIND 4096 25e262e32dSDavid Howells #define MS_MOVE 8192 26e262e32dSDavid Howells #define MS_REC 16384 27e262e32dSDavid Howells #define MS_VERBOSE 32768 /* War is peace. Verbosity is silence. 28e262e32dSDavid Howells MS_VERBOSE is deprecated. */ 29e262e32dSDavid Howells #define MS_SILENT 32768 30e262e32dSDavid Howells #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ 31e262e32dSDavid Howells #define MS_UNBINDABLE (1<<17) /* change to unbindable */ 32e262e32dSDavid Howells #define MS_PRIVATE (1<<18) /* change to private */ 33e262e32dSDavid Howells #define MS_SLAVE (1<<19) /* change to slave */ 34e262e32dSDavid Howells #define MS_SHARED (1<<20) /* change to shared */ 35e262e32dSDavid Howells #define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */ 36e262e32dSDavid Howells #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ 37e262e32dSDavid Howells #define MS_I_VERSION (1<<23) /* Update inode I_version field */ 38e262e32dSDavid Howells #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ 39e262e32dSDavid Howells #define MS_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */ 40e262e32dSDavid Howells 41e262e32dSDavid Howells /* These sb flags are internal to the kernel */ 42e262e32dSDavid Howells #define MS_SUBMOUNT (1<<26) 43e262e32dSDavid Howells #define MS_NOREMOTELOCK (1<<27) 44e262e32dSDavid Howells #define MS_NOSEC (1<<28) 45e262e32dSDavid Howells #define MS_BORN (1<<29) 46e262e32dSDavid Howells #define MS_ACTIVE (1<<30) 47e262e32dSDavid Howells #define MS_NOUSER (1<<31) 48e262e32dSDavid Howells 49e262e32dSDavid Howells /* 50e262e32dSDavid Howells * Superblock flags that can be altered by MS_REMOUNT 51e262e32dSDavid Howells */ 52e262e32dSDavid Howells #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION|\ 53e262e32dSDavid Howells MS_LAZYTIME) 54e262e32dSDavid Howells 55e262e32dSDavid Howells /* 56e262e32dSDavid Howells * Old magic mount flag and mask 57e262e32dSDavid Howells */ 58e262e32dSDavid Howells #define MS_MGC_VAL 0xC0ED0000 59e262e32dSDavid Howells #define MS_MGC_MSK 0xffff0000 60e262e32dSDavid Howells 61a07b2000SAl Viro /* 62a07b2000SAl Viro * open_tree() flags. 63a07b2000SAl Viro */ 64a07b2000SAl Viro #define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */ 65a07b2000SAl Viro #define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */ 66a07b2000SAl Viro 672db154b3SDavid Howells /* 682db154b3SDavid Howells * move_mount() flags. 692db154b3SDavid Howells */ 702db154b3SDavid Howells #define MOVE_MOUNT_F_SYMLINKS 0x00000001 /* Follow symlinks on from path */ 712db154b3SDavid Howells #define MOVE_MOUNT_F_AUTOMOUNTS 0x00000002 /* Follow automounts on from path */ 722db154b3SDavid Howells #define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 /* Empty from path permitted */ 732db154b3SDavid Howells #define MOVE_MOUNT_T_SYMLINKS 0x00000010 /* Follow symlinks on to path */ 742db154b3SDavid Howells #define MOVE_MOUNT_T_AUTOMOUNTS 0x00000020 /* Follow automounts on to path */ 752db154b3SDavid Howells #define MOVE_MOUNT_T_EMPTY_PATH 0x00000040 /* Empty to path permitted */ 762db154b3SDavid Howells #define MOVE_MOUNT__MASK 0x00000077 772db154b3SDavid Howells 7824dcb3d9SDavid Howells /* 7924dcb3d9SDavid Howells * fsopen() flags. 8024dcb3d9SDavid Howells */ 8124dcb3d9SDavid Howells #define FSOPEN_CLOEXEC 0x00000001 8224dcb3d9SDavid Howells 83ecdab150SDavid Howells /* 84cf3cba4aSDavid Howells * fspick() flags. 85cf3cba4aSDavid Howells */ 86cf3cba4aSDavid Howells #define FSPICK_CLOEXEC 0x00000001 87cf3cba4aSDavid Howells #define FSPICK_SYMLINK_NOFOLLOW 0x00000002 88cf3cba4aSDavid Howells #define FSPICK_NO_AUTOMOUNT 0x00000004 89cf3cba4aSDavid Howells #define FSPICK_EMPTY_PATH 0x00000008 90cf3cba4aSDavid Howells 91cf3cba4aSDavid Howells /* 92ecdab150SDavid Howells * The type of fsconfig() call made. 93ecdab150SDavid Howells */ 94ecdab150SDavid Howells enum fsconfig_command { 95ecdab150SDavid Howells FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ 96ecdab150SDavid Howells FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ 97ecdab150SDavid Howells FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ 98ecdab150SDavid Howells FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ 99ecdab150SDavid Howells FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ 100ecdab150SDavid Howells FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ 101ecdab150SDavid Howells FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ 102ecdab150SDavid Howells FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ 103ecdab150SDavid Howells }; 104ecdab150SDavid Howells 10593766fbdSDavid Howells /* 10693766fbdSDavid Howells * fsmount() flags. 10793766fbdSDavid Howells */ 10893766fbdSDavid Howells #define FSMOUNT_CLOEXEC 0x00000001 10993766fbdSDavid Howells 11093766fbdSDavid Howells /* 11193766fbdSDavid Howells * Mount attributes. 11293766fbdSDavid Howells */ 11393766fbdSDavid Howells #define MOUNT_ATTR_RDONLY 0x00000001 /* Mount read-only */ 11493766fbdSDavid Howells #define MOUNT_ATTR_NOSUID 0x00000002 /* Ignore suid and sgid bits */ 11593766fbdSDavid Howells #define MOUNT_ATTR_NODEV 0x00000004 /* Disallow access to device special files */ 11693766fbdSDavid Howells #define MOUNT_ATTR_NOEXEC 0x00000008 /* Disallow program execution */ 11793766fbdSDavid Howells #define MOUNT_ATTR__ATIME 0x00000070 /* Setting on how atime should be updated */ 11893766fbdSDavid Howells #define MOUNT_ATTR_RELATIME 0x00000000 /* - Update atime relative to mtime/ctime. */ 11993766fbdSDavid Howells #define MOUNT_ATTR_NOATIME 0x00000010 /* - Do not update access times. */ 12093766fbdSDavid Howells #define MOUNT_ATTR_STRICTATIME 0x00000020 /* - Always perform atime updates */ 12193766fbdSDavid Howells #define MOUNT_ATTR_NODIRATIME 0x00000080 /* Do not update directory access times */ 122*9caccd41SChristian Brauner #define MOUNT_ATTR_IDMAP 0x00100000 /* Idmap mount to @userns_fd in struct mount_attr. */ 12393766fbdSDavid Howells 1242a186721SChristian Brauner /* 1252a186721SChristian Brauner * mount_setattr() 1262a186721SChristian Brauner */ 1272a186721SChristian Brauner struct mount_attr { 1282a186721SChristian Brauner __u64 attr_set; 1292a186721SChristian Brauner __u64 attr_clr; 1302a186721SChristian Brauner __u64 propagation; 1312a186721SChristian Brauner __u64 userns_fd; 1322a186721SChristian Brauner }; 1332a186721SChristian Brauner 1342a186721SChristian Brauner /* List of all mount_attr versions. */ 1352a186721SChristian Brauner #define MOUNT_ATTR_SIZE_VER0 32 /* sizeof first published struct */ 1362a186721SChristian Brauner 137e262e32dSDavid Howells #endif /* _UAPI_LINUX_MOUNT_H */ 138