Skip to content

Commit ef058fc

Browse files
amir73ilbrauner
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent b13fb4e commit ef058fc

File tree

2 files changed

+42
-74
lines changed

2 files changed

+42
-74
lines changed

tools/testing/selftests/filesystems/wrappers.h

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,28 @@ static inline int sys_mount(const char *src, const char *tgt, const char *fst,
4040
#define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 /* Empty from path permitted */
4141
#endif
4242

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+
4365
static inline int sys_move_mount(int from_dfd, const char *from_pathname,
4466
int to_dfd, const char *to_pathname,
4567
unsigned int flags)
@@ -57,7 +79,25 @@ static inline int sys_move_mount(int from_dfd, const char *from_pathname,
5779
#endif
5880

5981
#ifndef AT_RECURSIVE
60-
#define AT_RECURSIVE 0x8000
82+
#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
83+
#endif
84+
85+
#ifndef __NR_open_tree
86+
#if defined __alpha__
87+
#define __NR_open_tree 538
88+
#elif defined _MIPS_SIM
89+
#if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */
90+
#define __NR_open_tree 4428
91+
#endif
92+
#if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */
93+
#define __NR_open_tree 6428
94+
#endif
95+
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
96+
#define __NR_open_tree 5428
97+
#endif
98+
#else
99+
#define __NR_open_tree 428
100+
#endif
61101
#endif
62102

63103
static inline int sys_open_tree(int dfd, const char *filename, unsigned int flags)

tools/testing/selftests/pidfd/pidfd_bind_mount.c

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -15,79 +15,7 @@
1515

1616
#include "pidfd.h"
1717
#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"
9119

9220
FIXTURE(pidfd_bind_mount) {
9321
char template[PATH_MAX];

0 commit comments

Comments
 (0)