Replace the incorrect local definitions in the fhandle test program
with more correct and current ones from SLES #include files.
Local defintions are only used in the case where the fhandle syscall
feature is present in the kernel, but support isn't present in glibc.
For now that particular config is only seen in SLES11SP3,
so the internal and local definitions must match the ones
from that distribution.
Test-Parameters: clientdistro=sles11sp3 testlist=sanity envdefinitions=ONLY=237
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: Ie2106325ecc2b2d2e6aeaba1cc3f8b995f503ba8
Reviewed-on: http://review.whamcloud.com/10189
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
#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 */
#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;
unsigned char f_handle[0];
};
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
#ifndef __NR_name_to_handle_at
#define __NR_name_to_handle_at 264
#endif
#define __NR_open_by_handle_at 265
#endif
#define __NR_open_by_handle_at 265
#endif
static inline int
name_to_handle_at(int mnt_fd, const char *filename, struct file_handle *fh,
int *mnt_id, int flags)
static inline int
name_to_handle_at(int mnt_fd, const char *filename, struct file_handle *fh,
int *mnt_id, int flags)