Back to home page

OSCL-LXR

 
 

    


0001 #ifndef _UAPI_LINUX_MOUNT_H
0002 #define _UAPI_LINUX_MOUNT_H
0003 
0004 #include <linux/types.h>
0005 
0006 /*
0007  * These are the fs-independent mount-flags: up to 32 flags are supported
0008  *
0009  * Usage of these is restricted within the kernel to core mount(2) code and
0010  * callers of sys_mount() only.  Filesystems should be using the SB_*
0011  * equivalent instead.
0012  */
0013 #define MS_RDONLY    1  /* Mount read-only */
0014 #define MS_NOSUID    2  /* Ignore suid and sgid bits */
0015 #define MS_NODEV     4  /* Disallow access to device special files */
0016 #define MS_NOEXEC    8  /* Disallow program execution */
0017 #define MS_SYNCHRONOUS  16  /* Writes are synced at once */
0018 #define MS_REMOUNT  32  /* Alter flags of a mounted FS */
0019 #define MS_MANDLOCK 64  /* Allow mandatory locks on an FS */
0020 #define MS_DIRSYNC  128 /* Directory modifications are synchronous */
0021 #define MS_NOSYMFOLLOW  256 /* Do not follow symlinks */
0022 #define MS_NOATIME  1024    /* Do not update access times. */
0023 #define MS_NODIRATIME   2048    /* Do not update directory access times */
0024 #define MS_BIND     4096
0025 #define MS_MOVE     8192
0026 #define MS_REC      16384
0027 #define MS_VERBOSE  32768   /* War is peace. Verbosity is silence.
0028                    MS_VERBOSE is deprecated. */
0029 #define MS_SILENT   32768
0030 #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
0031 #define MS_UNBINDABLE   (1<<17) /* change to unbindable */
0032 #define MS_PRIVATE  (1<<18) /* change to private */
0033 #define MS_SLAVE    (1<<19) /* change to slave */
0034 #define MS_SHARED   (1<<20) /* change to shared */
0035 #define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
0036 #define MS_KERNMOUNT    (1<<22) /* this is a kern_mount call */
0037 #define MS_I_VERSION    (1<<23) /* Update inode I_version field */
0038 #define MS_STRICTATIME  (1<<24) /* Always perform atime updates */
0039 #define MS_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */
0040 
0041 /* These sb flags are internal to the kernel */
0042 #define MS_SUBMOUNT     (1<<26)
0043 #define MS_NOREMOTELOCK (1<<27)
0044 #define MS_NOSEC    (1<<28)
0045 #define MS_BORN     (1<<29)
0046 #define MS_ACTIVE   (1<<30)
0047 #define MS_NOUSER   (1<<31)
0048 
0049 /*
0050  * Superblock flags that can be altered by MS_REMOUNT
0051  */
0052 #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION|\
0053              MS_LAZYTIME)
0054 
0055 /*
0056  * Old magic mount flag and mask
0057  */
0058 #define MS_MGC_VAL 0xC0ED0000
0059 #define MS_MGC_MSK 0xffff0000
0060 
0061 /*
0062  * open_tree() flags.
0063  */
0064 #define OPEN_TREE_CLONE     1       /* Clone the target tree and attach the clone */
0065 #define OPEN_TREE_CLOEXEC   O_CLOEXEC   /* Close the file on execve() */
0066 
0067 /*
0068  * move_mount() flags.
0069  */
0070 #define MOVE_MOUNT_F_SYMLINKS       0x00000001 /* Follow symlinks on from path */
0071 #define MOVE_MOUNT_F_AUTOMOUNTS     0x00000002 /* Follow automounts on from path */
0072 #define MOVE_MOUNT_F_EMPTY_PATH     0x00000004 /* Empty from path permitted */
0073 #define MOVE_MOUNT_T_SYMLINKS       0x00000010 /* Follow symlinks on to path */
0074 #define MOVE_MOUNT_T_AUTOMOUNTS     0x00000020 /* Follow automounts on to path */
0075 #define MOVE_MOUNT_T_EMPTY_PATH     0x00000040 /* Empty to path permitted */
0076 #define MOVE_MOUNT_SET_GROUP        0x00000100 /* Set sharing group instead */
0077 #define MOVE_MOUNT__MASK        0x00000177
0078 
0079 /*
0080  * fsopen() flags.
0081  */
0082 #define FSOPEN_CLOEXEC      0x00000001
0083 
0084 /*
0085  * fspick() flags.
0086  */
0087 #define FSPICK_CLOEXEC      0x00000001
0088 #define FSPICK_SYMLINK_NOFOLLOW 0x00000002
0089 #define FSPICK_NO_AUTOMOUNT 0x00000004
0090 #define FSPICK_EMPTY_PATH   0x00000008
0091 
0092 /*
0093  * The type of fsconfig() call made.
0094  */
0095 enum fsconfig_command {
0096     FSCONFIG_SET_FLAG   = 0,    /* Set parameter, supplying no value */
0097     FSCONFIG_SET_STRING = 1,    /* Set parameter, supplying a string value */
0098     FSCONFIG_SET_BINARY = 2,    /* Set parameter, supplying a binary blob value */
0099     FSCONFIG_SET_PATH   = 3,    /* Set parameter, supplying an object by path */
0100     FSCONFIG_SET_PATH_EMPTY = 4,    /* Set parameter, supplying an object by (empty) path */
0101     FSCONFIG_SET_FD     = 5,    /* Set parameter, supplying an object by fd */
0102     FSCONFIG_CMD_CREATE = 6,    /* Invoke superblock creation */
0103     FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
0104 };
0105 
0106 /*
0107  * fsmount() flags.
0108  */
0109 #define FSMOUNT_CLOEXEC     0x00000001
0110 
0111 /*
0112  * Mount attributes.
0113  */
0114 #define MOUNT_ATTR_RDONLY   0x00000001 /* Mount read-only */
0115 #define MOUNT_ATTR_NOSUID   0x00000002 /* Ignore suid and sgid bits */
0116 #define MOUNT_ATTR_NODEV    0x00000004 /* Disallow access to device special files */
0117 #define MOUNT_ATTR_NOEXEC   0x00000008 /* Disallow program execution */
0118 #define MOUNT_ATTR__ATIME   0x00000070 /* Setting on how atime should be updated */
0119 #define MOUNT_ATTR_RELATIME 0x00000000 /* - Update atime relative to mtime/ctime. */
0120 #define MOUNT_ATTR_NOATIME  0x00000010 /* - Do not update access times. */
0121 #define MOUNT_ATTR_STRICTATIME  0x00000020 /* - Always perform atime updates */
0122 #define MOUNT_ATTR_NODIRATIME   0x00000080 /* Do not update directory access times */
0123 #define MOUNT_ATTR_IDMAP    0x00100000 /* Idmap mount to @userns_fd in struct mount_attr. */
0124 #define MOUNT_ATTR_NOSYMFOLLOW  0x00200000 /* Do not follow symlinks */
0125 
0126 /*
0127  * mount_setattr()
0128  */
0129 struct mount_attr {
0130     __u64 attr_set;
0131     __u64 attr_clr;
0132     __u64 propagation;
0133     __u64 userns_fd;
0134 };
0135 
0136 /* List of all mount_attr versions. */
0137 #define MOUNT_ATTR_SIZE_VER0    32 /* sizeof first published struct */
0138 
0139 #endif /* _UAPI_LINUX_MOUNT_H */