rustix/backend/linux_raw/mount/
types.rs1use crate::backend::c;
2use bitflags::bitflags;
3
4bitflags! {
5 #[repr(transparent)]
9 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
10 pub struct MountFlags: c::c_uint {
11 const BIND = linux_raw_sys::general::MS_BIND;
13
14 const DIRSYNC = linux_raw_sys::general::MS_DIRSYNC;
16
17 const LAZYTIME = linux_raw_sys::general::MS_LAZYTIME;
19
20 #[doc(alias = "MANDLOCK")]
22 const PERMIT_MANDATORY_FILE_LOCKING = linux_raw_sys::general::MS_MANDLOCK;
23
24 const NOATIME = linux_raw_sys::general::MS_NOATIME;
26
27 const NODEV = linux_raw_sys::general::MS_NODEV;
29
30 const NODIRATIME = linux_raw_sys::general::MS_NODIRATIME;
32
33 const NOEXEC = linux_raw_sys::general::MS_NOEXEC;
35
36 const NOSUID = linux_raw_sys::general::MS_NOSUID;
38
39 const RDONLY = linux_raw_sys::general::MS_RDONLY;
41
42 const REC = linux_raw_sys::general::MS_REC;
44
45 const RELATIME = linux_raw_sys::general::MS_RELATIME;
47
48 const SILENT = linux_raw_sys::general::MS_SILENT;
50
51 const STRICTATIME = linux_raw_sys::general::MS_STRICTATIME;
53
54 const SYNCHRONOUS = linux_raw_sys::general::MS_SYNCHRONOUS;
56
57 const NOSYMFOLLOW = linux_raw_sys::general::MS_NOSYMFOLLOW;
59
60 const _ = !0;
62 }
63}
64
65bitflags! {
66 #[repr(transparent)]
70 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
71 pub struct UnmountFlags: c::c_uint {
72 const FORCE = linux_raw_sys::general::MNT_FORCE;
74 const DETACH = linux_raw_sys::general::MNT_DETACH;
76 const EXPIRE = linux_raw_sys::general::MNT_EXPIRE;
78 const NOFOLLOW = linux_raw_sys::general::UMOUNT_NOFOLLOW;
80
81 const _ = !0;
83 }
84}
85
86#[cfg(feature = "mount")]
87bitflags! {
88 #[repr(transparent)]
92 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
93 pub struct FsOpenFlags: c::c_uint {
94 const FSOPEN_CLOEXEC = linux_raw_sys::general::FSOPEN_CLOEXEC;
96
97 const _ = !0;
99 }
100}
101
102#[cfg(feature = "mount")]
103bitflags! {
104 #[repr(transparent)]
108 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
109 pub struct FsMountFlags: c::c_uint {
110 const FSMOUNT_CLOEXEC = linux_raw_sys::general::FSMOUNT_CLOEXEC;
112
113 const _ = !0;
115 }
116}
117
118#[cfg(feature = "mount")]
120#[derive(Debug, Copy, Clone, Eq, PartialEq)]
121#[repr(u32)]
122pub(crate) enum FsConfigCmd {
123 SetFlag = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_FLAG as u32,
125
126 SetString = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_STRING as u32,
128
129 SetBinary = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_BINARY as u32,
131
132 SetPath = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_PATH as u32,
134
135 SetPathEmpty = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_PATH_EMPTY as u32,
137
138 SetFd = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_FD as u32,
140
141 Create = linux_raw_sys::general::fsconfig_command::FSCONFIG_CMD_CREATE as u32,
143
144 Reconfigure = linux_raw_sys::general::fsconfig_command::FSCONFIG_CMD_RECONFIGURE as u32,
146}
147
148#[cfg(feature = "mount")]
149bitflags! {
150 #[repr(transparent)]
154 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
155 pub struct MountAttrFlags: c::c_uint {
156 const MOUNT_ATTR_RDONLY = linux_raw_sys::general::MOUNT_ATTR_RDONLY;
158
159 const MOUNT_ATTR_NOSUID = linux_raw_sys::general::MOUNT_ATTR_NOSUID;
161
162 const MOUNT_ATTR_NODEV = linux_raw_sys::general::MOUNT_ATTR_NODEV;
164
165 const MOUNT_ATTR_NOEXEC = linux_raw_sys::general::MOUNT_ATTR_NOEXEC;
167
168 const MOUNT_ATTR__ATIME = linux_raw_sys::general::MOUNT_ATTR__ATIME;
170
171 const MOUNT_ATTR_RELATIME = linux_raw_sys::general::MOUNT_ATTR_RELATIME;
173
174 const MOUNT_ATTR_NOATIME = linux_raw_sys::general::MOUNT_ATTR_NOATIME;
176
177 const MOUNT_ATTR_STRICTATIME = linux_raw_sys::general::MOUNT_ATTR_STRICTATIME;
179
180 const MOUNT_ATTR_NODIRATIME = linux_raw_sys::general::MOUNT_ATTR_NODIRATIME;
182
183 const MOUNT_ATTR_IDMAP = linux_raw_sys::general::MOUNT_ATTR_IDMAP;
185
186 const MOUNT_ATTR_NOSYMFOLLOW = linux_raw_sys::general::MOUNT_ATTR_NOSYMFOLLOW;
188
189 const MOUNT_ATTR_SIZE_VER0 = linux_raw_sys::general::MOUNT_ATTR_SIZE_VER0;
191
192 const _ = !0;
194 }
195}
196
197#[cfg(feature = "mount")]
198bitflags! {
199 #[repr(transparent)]
203 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
204 pub struct MoveMountFlags: c::c_uint {
205 const MOVE_MOUNT_F_SYMLINKS = linux_raw_sys::general::MOVE_MOUNT_F_SYMLINKS;
207
208 const MOVE_MOUNT_F_AUTOMOUNTS = linux_raw_sys::general::MOVE_MOUNT_F_AUTOMOUNTS;
210
211 const MOVE_MOUNT_F_EMPTY_PATH = linux_raw_sys::general::MOVE_MOUNT_F_EMPTY_PATH;
213
214 const MOVE_MOUNT_T_SYMLINKS = linux_raw_sys::general::MOVE_MOUNT_T_SYMLINKS;
216
217 const MOVE_MOUNT_T_AUTOMOUNTS = linux_raw_sys::general::MOVE_MOUNT_T_AUTOMOUNTS;
219
220 const MOVE_MOUNT_T_EMPTY_PATH = linux_raw_sys::general::MOVE_MOUNT_T_EMPTY_PATH;
222
223 const MOVE_MOUNT_SET_GROUP = linux_raw_sys::general::MOVE_MOUNT_SET_GROUP;
225
226 const MOVE_MOUNT_BENEATH = c::MOVE_MOUNT_BENEATH;
228
229 const MOVE_MOUNT__MASK = linux_raw_sys::general::MOVE_MOUNT__MASK;
231
232 const _ = !0;
234 }
235}
236
237#[cfg(feature = "mount")]
238bitflags! {
239 #[repr(transparent)]
243 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
244 pub struct OpenTreeFlags: c::c_uint {
245 const OPEN_TREE_CLONE = linux_raw_sys::general::OPEN_TREE_CLONE;
247
248 const OPEN_TREE_CLOEXEC = linux_raw_sys::general::OPEN_TREE_CLOEXEC;
250
251 const AT_EMPTY_PATH = linux_raw_sys::general::AT_EMPTY_PATH;
253
254 const AT_NO_AUTOMOUNT = linux_raw_sys::general::AT_NO_AUTOMOUNT;
256
257 const AT_RECURSIVE = linux_raw_sys::general::AT_RECURSIVE;
259
260 const AT_SYMLINK_NOFOLLOW = linux_raw_sys::general::AT_SYMLINK_NOFOLLOW;
262
263 const _ = !0;
265 }
266}
267
268#[cfg(feature = "mount")]
269bitflags! {
270 #[repr(transparent)]
274 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
275 pub struct FsPickFlags: c::c_uint {
276 const FSPICK_CLOEXEC = linux_raw_sys::general::FSPICK_CLOEXEC;
278
279 const FSPICK_SYMLINK_NOFOLLOW = linux_raw_sys::general::FSPICK_SYMLINK_NOFOLLOW;
281
282 const FSPICK_NO_AUTOMOUNT = linux_raw_sys::general::FSPICK_NO_AUTOMOUNT;
284
285 const FSPICK_EMPTY_PATH = linux_raw_sys::general::FSPICK_EMPTY_PATH;
287
288 const _ = !0;
290 }
291}
292
293bitflags! {
294 #[repr(transparent)]
298 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
299 pub struct MountPropagationFlags: c::c_uint {
300 const SILENT = linux_raw_sys::general::MS_SILENT;
302 const SHARED = linux_raw_sys::general::MS_SHARED;
304 const PRIVATE = linux_raw_sys::general::MS_PRIVATE;
306 const SLAVE = linux_raw_sys::general::MS_SLAVE;
308 const UNBINDABLE = linux_raw_sys::general::MS_UNBINDABLE;
310 const REC = linux_raw_sys::general::MS_REC;
312
313 const _ = !0;
315 }
316}
317
318bitflags! {
319 #[repr(transparent)]
320 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
321 pub(crate) struct InternalMountFlags: c::c_uint {
322 const REMOUNT = linux_raw_sys::general::MS_REMOUNT;
323 const MOVE = linux_raw_sys::general::MS_MOVE;
324
325 const _ = !0;
327 }
328}
329
330#[repr(transparent)]
331pub(crate) struct MountFlagsArg(pub(crate) c::c_uint);