Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/pidfd: move syscall definitions into wrappers.h

There was already duplicity in some of the defintions.

Remove syscall number defintions for __ia64__ that are
both stale and incorrect.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250509133240.529330-4-amir73il@gmail.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Amir Goldstein and committed by
Christian Brauner
ef058fc1 b13fb4ee

+42 -74
+41 -1
tools/testing/selftests/filesystems/wrappers.h
··· 40 40 #define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 /* Empty from path permitted */ 41 41 #endif 42 42 43 + #ifndef MOVE_MOUNT_T_EMPTY_PATH 44 + #define MOVE_MOUNT_T_EMPTY_PATH 0x00000040 /* Empty to path permitted */ 45 + #endif 46 + 47 + #ifndef __NR_move_mount 48 + #if defined __alpha__ 49 + #define __NR_move_mount 539 50 + #elif defined _MIPS_SIM 51 + #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ 52 + #define __NR_move_mount 4429 53 + #endif 54 + #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ 55 + #define __NR_move_mount 6429 56 + #endif 57 + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ 58 + #define __NR_move_mount 5429 59 + #endif 60 + #else 61 + #define __NR_move_mount 429 62 + #endif 63 + #endif 64 + 43 65 static inline int sys_move_mount(int from_dfd, const char *from_pathname, 44 66 int to_dfd, const char *to_pathname, 45 67 unsigned int flags) ··· 79 57 #endif 80 58 81 59 #ifndef AT_RECURSIVE 82 - #define AT_RECURSIVE 0x8000 60 + #define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */ 61 + #endif 62 + 63 + #ifndef __NR_open_tree 64 + #if defined __alpha__ 65 + #define __NR_open_tree 538 66 + #elif defined _MIPS_SIM 67 + #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ 68 + #define __NR_open_tree 4428 69 + #endif 70 + #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ 71 + #define __NR_open_tree 6428 72 + #endif 73 + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ 74 + #define __NR_open_tree 5428 75 + #endif 76 + #else 77 + #define __NR_open_tree 428 78 + #endif 83 79 #endif 84 80 85 81 static inline int sys_open_tree(int dfd, const char *filename, unsigned int flags)
+1 -73
tools/testing/selftests/pidfd/pidfd_bind_mount.c
··· 15 15 16 16 #include "pidfd.h" 17 17 #include "../kselftest_harness.h" 18 - 19 - #ifndef __NR_open_tree 20 - #if defined __alpha__ 21 - #define __NR_open_tree 538 22 - #elif defined _MIPS_SIM 23 - #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ 24 - #define __NR_open_tree 4428 25 - #endif 26 - #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ 27 - #define __NR_open_tree 6428 28 - #endif 29 - #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ 30 - #define __NR_open_tree 5428 31 - #endif 32 - #elif defined __ia64__ 33 - #define __NR_open_tree (428 + 1024) 34 - #else 35 - #define __NR_open_tree 428 36 - #endif 37 - #endif 38 - 39 - #ifndef __NR_move_mount 40 - #if defined __alpha__ 41 - #define __NR_move_mount 539 42 - #elif defined _MIPS_SIM 43 - #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ 44 - #define __NR_move_mount 4429 45 - #endif 46 - #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ 47 - #define __NR_move_mount 6429 48 - #endif 49 - #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ 50 - #define __NR_move_mount 5429 51 - #endif 52 - #elif defined __ia64__ 53 - #define __NR_move_mount (428 + 1024) 54 - #else 55 - #define __NR_move_mount 429 56 - #endif 57 - #endif 58 - 59 - #ifndef MOVE_MOUNT_F_EMPTY_PATH 60 - #define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 /* Empty from path permitted */ 61 - #endif 62 - 63 - #ifndef MOVE_MOUNT_F_EMPTY_PATH 64 - #define MOVE_MOUNT_T_EMPTY_PATH 0x00000040 /* Empty to path permitted */ 65 - #endif 66 - 67 - static inline int sys_move_mount(int from_dfd, const char *from_pathname, 68 - int to_dfd, const char *to_pathname, 69 - unsigned int flags) 70 - { 71 - return syscall(__NR_move_mount, from_dfd, from_pathname, to_dfd, 72 - to_pathname, flags); 73 - } 74 - 75 - #ifndef OPEN_TREE_CLONE 76 - #define OPEN_TREE_CLONE 1 77 - #endif 78 - 79 - #ifndef OPEN_TREE_CLOEXEC 80 - #define OPEN_TREE_CLOEXEC O_CLOEXEC 81 - #endif 82 - 83 - #ifndef AT_RECURSIVE 84 - #define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */ 85 - #endif 86 - 87 - static inline int sys_open_tree(int dfd, const char *filename, unsigned int flags) 88 - { 89 - return syscall(__NR_open_tree, dfd, filename, flags); 90 - } 18 + #include "../filesystems/wrappers.h" 91 19 92 20 FIXTURE(pidfd_bind_mount) { 93 21 char template[PATH_MAX];