From 763a0c796a2e24351da31f60a1762caef6a2bdb7 Mon Sep 17 00:00:00 2001 From: shadow Date: Wed, 11 Feb 2009 08:47:40 +0000 Subject: [PATCH] update client to support vanila kernels up to 2.6.27. Branch b1_8 b=14250 i=green i=deen --- lnet/autoconf/lustre-lnet.m4 | 18 ++++++++++++++++++ lnet/libcfs/linux/linux-prim.c | 2 +- lnet/libcfs/linux/linux-tcpip.c | 4 ++++ lnet/lnet/api-ni.c | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index b7c02e7..a9bbaf1 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -1362,6 +1362,22 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +# 2.6.27 have second argument to sock_map_fd +AC_DEFUN([LN_SOCK_MAP_FD_2ARG], +[AC_MSG_CHECKING([sock_map_fd have second argument]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + sock_map_fd(NULL, 0); +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SOCK_MAP_FD_2ARG, 1, + [sock_map_fd have second argument]) +],[ + AC_MSG_RESULT(NO) +]) +]) + # # LN_PROG_LINUX # @@ -1410,6 +1426,8 @@ LN_SYSCTL_UNNUMBERED LN_SCATTERLIST_SETPAGE # 2.6.26 LN_SEM_COUNT +# 2.6.27 +LN_SOCK_MAP_FD_2ARG ]) # diff --git a/lnet/libcfs/linux/linux-prim.c b/lnet/libcfs/linux/linux-prim.c index 3f221c1..d5fef80 100644 --- a/lnet/libcfs/linux/linux-prim.c +++ b/lnet/libcfs/linux/linux-prim.c @@ -49,7 +49,7 @@ void cfs_enter_debugger(void) { #if defined(CONFIG_KGDB) - BREAKPOINT(); +// BREAKPOINT(); #elif defined(__arch_um__) asm("int $3"); #else diff --git a/lnet/libcfs/linux/linux-tcpip.c b/lnet/libcfs/linux/linux-tcpip.c index bcf85b5..87d5214 100644 --- a/lnet/libcfs/linux/linux-tcpip.c +++ b/lnet/libcfs/linux/linux-tcpip.c @@ -63,7 +63,11 @@ libcfs_sock_ioctl(int cmd, unsigned long arg) return rc; } +#ifdef HAVE_SOCK_MAP_FD_2ARG + fd = sock_map_fd(sock,0); +#else fd = sock_map_fd(sock); +#endif if (fd < 0) { rc = fd; sock_release(sock); diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 8918fea..272bff4 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -1032,7 +1032,7 @@ lnet_startup_lndnis (void) #ifdef __KERNEL__ if (lnd == NULL) { LNET_MUTEX_UP(&the_lnet.ln_lnd_mutex); - rc = request_module(libcfs_lnd2modname(lnd_type)); + rc = request_module("%s", libcfs_lnd2modname(lnd_type)); LNET_MUTEX_DOWN(&the_lnet.ln_lnd_mutex); lnd = lnet_find_lnd_by_type(lnd_type); -- 1.8.3.1