From 5b41b2659d35b72636ab50a28d6815cad9c22a66 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 31 Jan 2022 10:04:57 -0300 Subject: 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 Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/sys/mount.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sysdeps/unix/sysv/linux/sys') diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h index 6d55c55de8..50ec65c7a3 100644 --- a/sysdeps/unix/sysv/linux/sys/mount.h +++ b/sysdeps/unix/sysv/linux/sys/mount.h @@ -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 */ -- cgit v1.2.3-70-g09d2