From 68e93b2db155ed8353f1a4db9426f0cdd7a1b727 Mon Sep 17 00:00:00 2001 From: pjkirner Date: Wed, 28 Sep 2005 00:01:08 +0000 Subject: [PATCH] * Commit small patch for lnet to allow Lustre to build against a 2.6.12 kernel. (From adliger) --- lnet/include/libcfs/linux/kp30.h | 2 +- lnet/include/libcfs/linux/libcfs.h | 2 +- lnet/klnds/socklnd/socklnd_lib-linux.c | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lnet/include/libcfs/linux/kp30.h b/lnet/include/libcfs/linux/kp30.h index 84e1c0d..5f9d13a 100644 --- a/lnet/include/libcfs/linux/kp30.h +++ b/lnet/include/libcfs/linux/kp30.h @@ -119,7 +119,7 @@ do { \ #define PORTAL_SYMBOL_REGISTER(x) inter_module_register(#x, THIS_MODULE, &x) #define PORTAL_SYMBOL_UNREGISTER(x) inter_module_unregister(#x) -#define PORTAL_SYMBOL_GET(x) ((typeof(&x))inter_module_get(#x)) +#define PORTAL_SYMBOL_GET(x) inter_module_get(#x) #define PORTAL_SYMBOL_PUT(x) inter_module_put(#x) #define PORTAL_MODULE_USE MOD_INC_USE_COUNT diff --git a/lnet/include/libcfs/linux/libcfs.h b/lnet/include/libcfs/linux/libcfs.h index 29bcce3..1351add 100644 --- a/lnet/include/libcfs/linux/libcfs.h +++ b/lnet/include/libcfs/linux/libcfs.h @@ -88,7 +88,7 @@ struct ptldebug_header { #define LUSTRE_TRACE_SIZE (THREAD_SIZE >> 5) -#ifdef __KERNEL__ +#if defined(__KERNEL__) && !defined(__x86_64__) # ifdef __ia64__ # define CDEBUG_STACK (THREAD_SIZE - \ ((unsigned long)__builtin_dwarf_cfa() & \ diff --git a/lnet/klnds/socklnd/socklnd_lib-linux.c b/lnet/klnds/socklnd/socklnd_lib-linux.c index 294edbf..963aa9f 100644 --- a/lnet/klnds/socklnd/socklnd_lib-linux.c +++ b/lnet/klnds/socklnd/socklnd_lib-linux.c @@ -653,6 +653,8 @@ struct tcp_opt *sock2tcp_opt(struct sock *sk) { return &(sk->tp_pinfo.af_tcp); } +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) +#define sock2tcp_opt(sk) tcp_sk(sk) #else struct tcp_opt *sock2tcp_opt(struct sock *sk) { @@ -665,7 +667,11 @@ void ksocknal_lib_push_conn (ksock_conn_t *conn) { struct sock *sk; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)) struct tcp_opt *tp; +#else + struct tcp_sock *tp; +#endif int nonagle; int val = 1; int rc; -- 1.8.3.1