X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fcheck_fhandle_syscalls.c;h=771ac9c980709d55fe3ef0f9b4c570402b798eca;hp=8094774825322b439722a52744a3fa73adb10bd0;hb=2b8c758767f3b2c7579f8635e31166ffc0f521d2;hpb=3f5fc6412d3ae2d3a57f8fdb8a457f35e9d9576e diff --git a/lustre/tests/check_fhandle_syscalls.c b/lustre/tests/check_fhandle_syscalls.c index 8094774..771ac9c 100644 --- a/lustre/tests/check_fhandle_syscalls.c +++ b/lustre/tests/check_fhandle_syscalls.c @@ -40,7 +40,7 @@ #include #include -#include +#include #include #define MAX_HANDLE_SZ 128 @@ -48,14 +48,35 @@ #if !defined(HAVE_FHANDLE_GLIBC_SUPPORT) && defined(HAVE_FHANDLE_SYSCALLS) /* Because the kernel supports this functions doesn't mean that glibc does. * Just in case we define what we need */ -struct file_handle -{ - unsigned int handle_bytes; +struct file_handle { + __u32 handle_bytes; int handle_type; - /* File identifier. */ + /* file identifier */ unsigned char f_handle[0]; }; +#if defined(_ASM_X86_UNISTD_64_H) + +#ifndef __NR_name_to_handle_at +#define __NR_name_to_handle_at 303 +#endif + +#ifndef __NR_open_by_handle_at +#define __NR_open_by_handle_at 304 +#endif + +#elif defined(_ASM_X86_UNISTD_32_H) + +#ifndef __NR_name_to_handle_at +#define __NR_name_to_handle_at 341 +#endif + +#ifndef __NR_open_by_handle_at +#define __NR_open_by_handle_at 342 +#endif + +#else + #ifndef __NR_name_to_handle_at #define __NR_name_to_handle_at 264 #endif @@ -64,6 +85,9 @@ struct file_handle #define __NR_open_by_handle_at 265 #endif + +#endif + static inline int name_to_handle_at(int mnt_fd, const char *filename, struct file_handle *fh, int *mnt_id, int flags)