1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __IDMAP_MISSING_H
4 #define __IDMAP_MISSING_H
12 #include <linux/types.h>
18 #include <sys/types.h>
22 #ifndef __NR_mount_setattr
24 #define __NR_mount_setattr 552
25 #elif defined _MIPS_SIM
26 #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */
27 #define __NR_mount_setattr (442 + 4000)
29 #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */
30 #define __NR_mount_setattr (442 + 6000)
32 #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
33 #define __NR_mount_setattr (442 + 5000)
35 #elif defined __ia64__
36 #define __NR_mount_setattr (442 + 1024)
38 #define __NR_mount_setattr 442
42 #ifndef __NR_open_tree
44 #define __NR_open_tree 538
45 #elif defined _MIPS_SIM
46 #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */
47 #define __NR_open_tree 4428
49 #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */
50 #define __NR_open_tree 6428
52 #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
53 #define __NR_open_tree 5428
55 #elif defined __ia64__
56 #define __NR_open_tree (428 + 1024)
58 #define __NR_open_tree 428
62 #ifndef __NR_move_mount
64 #define __NR_move_mount 539
65 #elif defined _MIPS_SIM
66 #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */
67 #define __NR_move_mount 4429
69 #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */
70 #define __NR_move_mount 6429
72 #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
73 #define __NR_move_mount 5429
75 #elif defined __ia64__
76 #define __NR_move_mount (428 + 1024)
78 #define __NR_move_mount 429
91 #define MS_PRIVATE (1 << 18)
94 #ifndef MOVE_MOUNT_F_EMPTY_PATH
95 #define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 /* Empty from path permitted */
98 #ifndef MOUNT_ATTR_IDMAP
99 #define MOUNT_ATTR_IDMAP 0x00100000
102 #ifndef OPEN_TREE_CLONE
103 #define OPEN_TREE_CLONE 1
106 #ifndef OPEN_TREE_CLOEXEC
107 #define OPEN_TREE_CLOEXEC O_CLOEXEC
111 #define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
114 #ifndef HAVE_STRUCT_MOUNT_ATTR
123 static inline int sys_mount_setattr(int dfd, const char *path, unsigned int flags,
124 struct mount_attr *attr, size_t size)
126 return syscall(__NR_mount_setattr, dfd, path, flags, attr, size);
129 static inline int sys_open_tree(int dfd, const char *filename, unsigned int flags)
131 return syscall(__NR_open_tree, dfd, filename, flags);
134 static inline int sys_move_mount(int from_dfd, const char *from_pathname, int to_dfd,
135 const char *to_pathname, unsigned int flags)
137 return syscall(__NR_move_mount, from_dfd, from_pathname, to_dfd, to_pathname, flags);
140 static inline int sys_mount(const char *source, const char *target, const char *fstype,
141 unsigned long int flags, const void *data)
143 return syscall(__NR_mount, source, target, fstype, flags, data);
146 static inline int sys_umount2(const char *path, int flags)
148 return syscall(__NR_umount2, path, flags);
151 #endif /* __IDMAP_MISSING_H */