master
h 58 lines 1.61 KB
Raw
1 /*++
2
3 Copyright (c) Microsoft. All rights reserved.
4
5 Module Name:
6
7 lxtmount.h
8
9 Abstract:
10
11 This file contains mount primitive support.
12
13 --*/
14
15 #define MOUNT_PROC_MOUNTS "/proc/mounts"
16 #define MOUNT_PROC_MOUNTINFO "/proc/self/mountinfo"
17 #define MOUNT_PROC_MOUNTSTATS "/proc/self/mountstats"
18 #define MOUNT_SOURCE_DELETED (0x1)
19 #define MOUNT_FIRST_MOUNT (0x2)
20
21 //
22 // Flags for the unshare helper.
23 //
24
25 #define MOUNT_NAMESPACE_USE_CLONE (0x1)
26
27 int MountCheckIsMount(
28 const char* Path,
29 int ExpectedParentId,
30 const char* ExpectedSource,
31 const char* ExpectedFsType,
32 const char* ExpectedRoot,
33 const char* ExpectedMountOptions,
34 const char* ExpectedFsOptions,
35 const char* ExpectedCombinedOptions,
36 int Flags);
37
38 int MountCheckIsNotMount(const char* Path);
39
40 int MountFindMount(const char* MountsFile, const char* MountPoint, dev_t Device, struct libmnt_table** Table, struct libmnt_fs** FileSystem, int Direction);
41
42 int MountFindMountStats(const char* Device, const char* MountPoint, const char* FsType);
43
44 int MountFindMountStatsLine(char* ExpectedLine);
45
46 int MountGetFileSystem(const char* Path, char* FsType, int FsTypeLength, char* Options, int OptionsLength);
47
48 int MountGetMountId(const char* Path);
49
50 int MountGetMountOptions(const char* Path, char* Options);
51
52 int MountIsFileSystem(const char* Path, const char* FsType);
53
54 int MountIsMount(int DirFd, const char* Path);
55
56 int MountPrepareTmpfs(char* Path, char* Device, int ExpectedParentId);
57
58 int MountPrepareTmpfsEx(char* Path, char* Device, int ExpectedParentId, int Flags, const char* ExpectedOptions);