2013-12-18 19:42:49 -05:00
|
|
|
package mount
|
|
|
|
|
|
|
|
import (
|
2017-05-23 10:22:32 -04:00
|
|
|
"golang.org/x/sys/unix"
|
2013-12-18 19:42:49 -05:00
|
|
|
)
|
|
|
|
|
2014-03-20 11:52:12 -04:00
|
|
|
const (
|
2015-03-28 09:29:33 -04:00
|
|
|
// RDONLY will mount the file system read-only.
|
2017-05-23 10:22:32 -04:00
|
|
|
RDONLY = unix.MS_RDONLY
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// NOSUID will not allow set-user-identifier or set-group-identifier bits to
|
|
|
|
// take effect.
|
2017-05-23 10:22:32 -04:00
|
|
|
NOSUID = unix.MS_NOSUID
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// NODEV will not interpret character or block special devices on the file
|
|
|
|
// system.
|
2017-05-23 10:22:32 -04:00
|
|
|
NODEV = unix.MS_NODEV
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// NOEXEC will not allow execution of any binaries on the mounted file system.
|
2017-05-23 10:22:32 -04:00
|
|
|
NOEXEC = unix.MS_NOEXEC
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// SYNCHRONOUS will allow I/O to the file system to be done synchronously.
|
2017-05-23 10:22:32 -04:00
|
|
|
SYNCHRONOUS = unix.MS_SYNCHRONOUS
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// DIRSYNC will force all directory updates within the file system to be done
|
2015-12-13 11:00:39 -05:00
|
|
|
// synchronously. This affects the following system calls: create, link,
|
2015-03-28 09:29:33 -04:00
|
|
|
// unlink, symlink, mkdir, rmdir, mknod and rename.
|
2017-05-23 10:22:32 -04:00
|
|
|
DIRSYNC = unix.MS_DIRSYNC
|
2015-03-28 09:29:33 -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-05-23 10:22:32 -04:00
|
|
|
REMOUNT = unix.MS_REMOUNT
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// MANDLOCK will force mandatory locks on a filesystem.
|
2017-05-23 10:22:32 -04:00
|
|
|
MANDLOCK = unix.MS_MANDLOCK
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// NOATIME will not update the file access time when reading from a file.
|
2017-05-23 10:22:32 -04:00
|
|
|
NOATIME = unix.MS_NOATIME
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// NODIRATIME will not update the directory access time.
|
2017-05-23 10:22:32 -04:00
|
|
|
NODIRATIME = unix.MS_NODIRATIME
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// BIND remounts a subtree somewhere else.
|
2017-05-23 10:22:32 -04:00
|
|
|
BIND = unix.MS_BIND
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// RBIND remounts a subtree and all possible submounts somewhere else.
|
2017-05-23 10:22:32 -04:00
|
|
|
RBIND = unix.MS_BIND | unix.MS_REC
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// UNBINDABLE creates a mount which cannot be cloned through a bind operation.
|
2017-05-23 10:22:32 -04:00
|
|
|
UNBINDABLE = unix.MS_UNBINDABLE
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// RUNBINDABLE marks the entire mount tree as UNBINDABLE.
|
2017-05-23 10:22:32 -04:00
|
|
|
RUNBINDABLE = unix.MS_UNBINDABLE | unix.MS_REC
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// PRIVATE creates a mount which carries no propagation abilities.
|
2017-05-23 10:22:32 -04:00
|
|
|
PRIVATE = unix.MS_PRIVATE
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// RPRIVATE marks the entire mount tree as PRIVATE.
|
2017-05-23 10:22:32 -04:00
|
|
|
RPRIVATE = unix.MS_PRIVATE | unix.MS_REC
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// SLAVE creates a mount which receives propagation from its master, but not
|
|
|
|
// vice versa.
|
2017-05-23 10:22:32 -04:00
|
|
|
SLAVE = unix.MS_SLAVE
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// RSLAVE marks the entire mount tree as SLAVE.
|
2017-05-23 10:22:32 -04:00
|
|
|
RSLAVE = unix.MS_SLAVE | unix.MS_REC
|
2015-03-28 09:29:33 -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-05-23 10:22:32 -04:00
|
|
|
SHARED = unix.MS_SHARED
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// RSHARED marks the entire mount tree as SHARED.
|
2017-05-23 10:22:32 -04:00
|
|
|
RSHARED = unix.MS_SHARED | unix.MS_REC
|
2015-03-28 09:29:33 -04:00
|
|
|
|
|
|
|
// RELATIME updates inode access times relative to modify or change time.
|
2017-05-23 10:22:32 -04:00
|
|
|
RELATIME = unix.MS_RELATIME
|
2015-03-28 09:29:33 -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-05-23 10:22:32 -04:00
|
|
|
STRICTATIME = unix.MS_STRICTATIME
|
2017-02-27 11:32:49 -05:00
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
mntDetach = unix.MNT_DETACH
|
2014-03-20 11:52:12 -04:00
|
|
|
)
|