2020-04-16 05:23:37 -04:00
|
|
|
package mount
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
import (
|
2017-08-07 05:52:40 -04:00
|
|
|
"golang.org/x/sys/unix"
|
2017-05-10 17:13:36 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
// RDONLY will mount the file system read-only.
|
2017-08-07 05:52:40 -04:00
|
|
|
RDONLY = unix.MS_RDONLY
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// NOSUID will not allow set-user-identifier or set-group-identifier bits to
|
|
|
|
// take effect.
|
2017-08-07 05:52:40 -04:00
|
|
|
NOSUID = unix.MS_NOSUID
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// NODEV will not interpret character or block special devices on the file
|
|
|
|
// system.
|
2017-08-07 05:52:40 -04:00
|
|
|
NODEV = unix.MS_NODEV
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// NOEXEC will not allow execution of any binaries on the mounted file system.
|
2017-08-07 05:52:40 -04:00
|
|
|
NOEXEC = unix.MS_NOEXEC
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// SYNCHRONOUS will allow I/O to the file system to be done synchronously.
|
2017-08-07 05:52:40 -04:00
|
|
|
SYNCHRONOUS = unix.MS_SYNCHRONOUS
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// DIRSYNC will force all directory updates within the file system to be done
|
|
|
|
// synchronously. This affects the following system calls: create, link,
|
|
|
|
// unlink, symlink, mkdir, rmdir, mknod and rename.
|
2017-08-07 05:52:40 -04:00
|
|
|
DIRSYNC = unix.MS_DIRSYNC
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// REMOUNT will attempt to remount an already-mounted file system. This is
|
|
|
|
// commonly used to change the mount flags for a file system, especially to
|
|
|
|
// make a readonly file system writeable. It does not change device or mount
|
|
|
|
// point.
|
2017-08-07 05:52:40 -04:00
|
|
|
REMOUNT = unix.MS_REMOUNT
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// MANDLOCK will force mandatory locks on a filesystem.
|
2017-08-07 05:52:40 -04:00
|
|
|
MANDLOCK = unix.MS_MANDLOCK
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// NOATIME will not update the file access time when reading from a file.
|
2017-08-07 05:52:40 -04:00
|
|
|
NOATIME = unix.MS_NOATIME
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// NODIRATIME will not update the directory access time.
|
2017-08-07 05:52:40 -04:00
|
|
|
NODIRATIME = unix.MS_NODIRATIME
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// BIND remounts a subtree somewhere else.
|
2017-08-07 05:52:40 -04:00
|
|
|
BIND = unix.MS_BIND
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// RBIND remounts a subtree and all possible submounts somewhere else.
|
2017-08-07 05:52:40 -04:00
|
|
|
RBIND = unix.MS_BIND | unix.MS_REC
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// UNBINDABLE creates a mount which cannot be cloned through a bind operation.
|
2017-08-07 05:52:40 -04:00
|
|
|
UNBINDABLE = unix.MS_UNBINDABLE
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// RUNBINDABLE marks the entire mount tree as UNBINDABLE.
|
2017-08-07 05:52:40 -04:00
|
|
|
RUNBINDABLE = unix.MS_UNBINDABLE | unix.MS_REC
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// PRIVATE creates a mount which carries no propagation abilities.
|
2017-08-07 05:52:40 -04:00
|
|
|
PRIVATE = unix.MS_PRIVATE
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// RPRIVATE marks the entire mount tree as PRIVATE.
|
2017-08-07 05:52:40 -04:00
|
|
|
RPRIVATE = unix.MS_PRIVATE | unix.MS_REC
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// SLAVE creates a mount which receives propagation from its master, but not
|
|
|
|
// vice versa.
|
2017-08-07 05:52:40 -04:00
|
|
|
SLAVE = unix.MS_SLAVE
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// RSLAVE marks the entire mount tree as SLAVE.
|
2017-08-07 05:52:40 -04:00
|
|
|
RSLAVE = unix.MS_SLAVE | unix.MS_REC
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// SHARED creates a mount which provides the ability to create mirrors of
|
|
|
|
// that mount such that mounts and unmounts within any of the mirrors
|
|
|
|
// propagate to the other mirrors.
|
2017-08-07 05:52:40 -04:00
|
|
|
SHARED = unix.MS_SHARED
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// RSHARED marks the entire mount tree as SHARED.
|
2017-08-07 05:52:40 -04:00
|
|
|
RSHARED = unix.MS_SHARED | unix.MS_REC
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// RELATIME updates inode access times relative to modify or change time.
|
2017-08-07 05:52:40 -04:00
|
|
|
RELATIME = unix.MS_RELATIME
|
2017-05-10 17:13:36 -04:00
|
|
|
|
|
|
|
// STRICTATIME allows to explicitly request full atime updates. This makes
|
|
|
|
// it possible for the kernel to default to relatime or noatime but still
|
|
|
|
// allow userspace to override it.
|
2017-08-07 05:52:40 -04:00
|
|
|
STRICTATIME = unix.MS_STRICTATIME
|
2017-05-10 17:13:36 -04:00
|
|
|
|
2017-08-07 05:52:40 -04:00
|
|
|
mntDetach = unix.MNT_DETACH
|
2017-05-10 17:13:36 -04:00
|
|
|
)
|