Whamcloud - gitweb
LU-1337 kernel: NETIF_F_NO_CSUM and LOOKUP_CONTINUE removed
authorLiu Xuezhao <xuezhao.liu@emc.com>
Tue, 26 Jun 2012 02:53:06 +0000 (10:53 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 31 Jul 2012 15:38:56 +0000 (11:38 -0400)
1. kernel: 3.3 removes NETIF_F_NO_CSUM feature bit
   (kernel commit 34324dc2bf27c1773045fea63cb11f7e2a6ad2b9)
   The only one place uses NETIF_F_NO_CSUM is to check
   "(caps & (NETIF_F_IP_CSUM | NETIF_F_NO_CSUM | NETIF_F_HW_CSUM))".
   Replace (NETIF_F_IP_CSUM | NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
   as NETIF_F_ALL_CSUM which was added since kernel 2.6.17
   (kernel commit 8648b3053bff39a7ee4c711d74268079c928a657)
2. Kernel 3.1 kills LOOKUP_CONTINUE, LOOKUP_PARENT is equivalent
   to it since that.
   See kernel commit 49084c3bb2055c401f3493c13edae14d49128ca0

Another minor change is adding "#include <linux/module.h>" to
libcfs/linux/linux-crypto-adler.c, linux-crypto-crc32.c.

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Change-Id: I4f3621fcb921c866b33881027a4a0a491d676640
Reviewed-on: http://review.whamcloud.com/3398
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
libcfs/libcfs/linux/linux-crypto-adler.c
libcfs/libcfs/linux/linux-crypto-crc32.c
lnet/klnds/socklnd/socklnd_lib-linux.c
lustre/llite/llite_internal.h

index 9eeda9c..5b74389 100644 (file)
@@ -29,6 +29,7 @@
  * This is crypto api shash wrappers to zlib_adler32.
  */
 
  * This is crypto api shash wrappers to zlib_adler32.
  */
 
+#include <linux/module.h>
 #include <linux/zutil.h>
 #ifdef HAVE_STRUCT_SHASH_ALG
 #include <crypto/internal/hash.h>
 #include <linux/zutil.h>
 #ifdef HAVE_STRUCT_SHASH_ALG
 #include <crypto/internal/hash.h>
index 0c8fc25..bc40867 100644 (file)
@@ -29,6 +29,7 @@
  * This is crypto api shash wrappers to crc32_le.
  */
 
  * This is crypto api shash wrappers to crc32_le.
  */
 
+#include <linux/module.h>
 #include <linux/crc32.h>
 #ifdef HAVE_STRUCT_SHASH_ALG
 #include <crypto/internal/hash.h>
 #include <linux/crc32.h>
 #ifdef HAVE_STRUCT_SHASH_ALG
 #include <crypto/internal/hash.h>
index a375342..445ea61 100644 (file)
@@ -432,15 +432,14 @@ ksocknal_lib_get_conn_addrs (ksock_conn_t *conn)
 int
 ksocknal_lib_zc_capable(ksock_conn_t *conn)
 {
 int
 ksocknal_lib_zc_capable(ksock_conn_t *conn)
 {
-        int  caps = conn->ksnc_sock->sk->sk_route_caps;
+       int  caps = conn->ksnc_sock->sk->sk_route_caps;
 
 
-        if (conn->ksnc_proto == &ksocknal_protocol_v1x)
-                return 0;
+       if (conn->ksnc_proto == &ksocknal_protocol_v1x)
+               return 0;
 
 
-        /* ZC if the socket supports scatter/gather and doesn't need software
-         * checksums */
-        return ((caps & NETIF_F_SG) != 0 &&
-                (caps & (NETIF_F_IP_CSUM | NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)) != 0);
+       /* ZC if the socket supports scatter/gather and doesn't need software
+        * checksums */
+       return ((caps & NETIF_F_SG) != 0 && (caps & NETIF_F_ALL_CSUM) != 0);
 }
 
 int
 }
 
 int
index 02f80bf..e40a434 100644 (file)
 #define VM_FAULT_RETRY 0
 #endif
 
 #define VM_FAULT_RETRY 0
 #endif
 
+/* Kernel 3.1 kills LOOKUP_CONTINUE, LOOKUP_PARENT is equivalent to it.
+ * seem kernel commit 49084c3bb2055c401f3493c13edae14d49128ca0 */
+#ifndef LOOKUP_CONTINUE
+#define LOOKUP_CONTINUE LOOKUP_PARENT
+#endif
+
 /** Only used on client-side for indicating the tail of dir hash/offset. */
 #define LL_DIR_END_OFF          0x7fffffffffffffffULL
 #define LL_DIR_END_OFF_32BIT    0x7fffffffUL
 /** Only used on client-side for indicating the tail of dir hash/offset. */
 #define LL_DIR_END_OFF          0x7fffffffffffffffULL
 #define LL_DIR_END_OFF_32BIT    0x7fffffffUL