mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
linux: Add move_mount
It was added on Linux 5.2 (2db154b3ea8e14b04fee23e3fdfd5e9d17fbc6ae) as way t move a mount from one place to another and, in the next commit, allow to attach an unattached mount tree. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
parent
b4deb7beb8
commit
5b41b2659d
8
NEWS
8
NEWS
@ -41,10 +41,10 @@ Major new features:
|
||||
have adverse impact. It is incompatible with EDNS0 usage and DNSSEC
|
||||
validation by applications.
|
||||
|
||||
* On Linux, the fsopen and fsmount functions have been added. They are part
|
||||
of the new Linux kernel mount APIs that allow applications to more flexibly
|
||||
configure and operate on filesystem mounts. The new mount APIs are
|
||||
specifically designed to work with namespaces.
|
||||
* On Linux, the fsopen, fsmount, and move_mount functions have been added.
|
||||
They are part of the new Linux kernel mount APIs that allow applications
|
||||
to more flexibly configure and operate on filesystem mounts. The new
|
||||
mount APIs are specifically designed to work with namespaces.
|
||||
|
||||
Deprecated and removed features, and other changes affecting compatibility:
|
||||
|
||||
|
@ -302,6 +302,7 @@ libc {
|
||||
GLIBC_2.36 {
|
||||
fsmount;
|
||||
fsopen;
|
||||
move_mount;
|
||||
pidfd_open;
|
||||
pidfd_getfd;
|
||||
pidfd_send_signal;
|
||||
|
@ -2618,6 +2618,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2715,6 +2715,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2379,6 +2379,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -498,6 +498,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -495,6 +495,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2654,6 +2654,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2603,6 +2603,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2787,6 +2787,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2553,6 +2553,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -499,6 +499,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2730,6 +2730,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2703,6 +2703,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2700,6 +2700,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2695,6 +2695,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2693,6 +2693,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2701,6 +2701,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2604,6 +2604,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2742,6 +2742,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2125,6 +2125,7 @@ GLIBC_2.35 writev F
|
||||
GLIBC_2.35 wscanf F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2757,6 +2757,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2790,6 +2790,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2512,6 +2512,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2814,6 +2814,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2381,6 +2381,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2581,6 +2581,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2755,6 +2755,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2549,6 +2549,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2610,6 +2610,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2607,6 +2607,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2750,6 +2750,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2576,6 +2576,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -154,6 +154,16 @@ enum
|
||||
#define MOUNT_ATTR_NOSYMFOLLOW 0x00200000 /* Do not follow symlinks. */
|
||||
|
||||
|
||||
/* move_mount flags. */
|
||||
#define MOVE_MOUNT_F_SYMLINKS 0x00000001 /* Follow symlinks on from path */
|
||||
#define MOVE_MOUNT_F_AUTOMOUNTS 0x00000002 /* Follow automounts on from path */
|
||||
#define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 /* Empty from path permitted */
|
||||
#define MOVE_MOUNT_T_SYMLINKS 0x00000010 /* Follow symlinks on to path */
|
||||
#define MOVE_MOUNT_T_AUTOMOUNTS 0x00000020 /* Follow automounts on to path */
|
||||
#define MOVE_MOUNT_T_EMPTY_PATH 0x00000040 /* Empty to path permitted */
|
||||
#define MOVE_MOUNT_SET_GROUP 0x00000100 /* Set sharing group instead */
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Mount a filesystem. */
|
||||
@ -176,6 +186,13 @@ extern int fsopen (const char *__fs_name, unsigned int __flags) __THROW;
|
||||
extern int fsmount (int __fd, unsigned int __flags,
|
||||
unsigned int __ms_flags) __THROW;
|
||||
|
||||
/* Add the mounted FROM_DFD referenced by FROM_PATHNAME filesystem returned
|
||||
by fsmount in the hierarchy in the place TO_DFD reference by TO_PATHNAME
|
||||
using FLAGS. */
|
||||
extern int move_mount (int __from_dfd, const char *__from_pathname,
|
||||
int __to_dfd, const char *__to_pathname,
|
||||
unsigned int flags) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_MOUNT_H */
|
||||
|
@ -37,6 +37,7 @@ mincore - mincore i:aUV mincore
|
||||
mlock - mlock i:bU mlock
|
||||
mlockall - mlockall i:i mlockall
|
||||
mount EXTRA mount i:sssUp __mount mount
|
||||
move_mount EXTRA move_mount i:isisU move_mount
|
||||
munlock - munlock i:aU munlock
|
||||
munlockall - munlockall i: munlockall
|
||||
nfsservctl EXTRA nfsservctl i:ipp __compat_nfsservctl nfsservctl@GLIBC_2.0:GLIBC_2.28
|
||||
|
@ -51,7 +51,9 @@ def main():
|
||||
|
||||
status = max(
|
||||
check('FSOPEN_.*'),
|
||||
check('FSMOUNT_.*'))
|
||||
check('FSMOUNT_.*'),
|
||||
# MOVE_MOUNT__MASK may vary depending of the kernel version.
|
||||
check('MOVE_MOUNT_.*', 'MOVE_MOUNT__MASK'))
|
||||
sys.exit(status)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -2527,6 +2527,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2633,6 +2633,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 fsmount F
|
||||
GLIBC_2.36 fsopen F
|
||||
GLIBC_2.36 move_mount F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
Loading…
Reference in New Issue
Block a user