Whamcloud - gitweb
LU-867 gss: adapt to 2.6.32 kernel changes cache_detail
authorBobi Jam <bobijam@whamcloud.com>
Mon, 19 Dec 2011 01:35:27 +0000 (09:35 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 19 Jan 2012 17:52:48 +0000 (12:52 -0500)
2.6.32 kernel changes cache_detail's member cache_request to
cache_upcall.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I3ddec24e88fd271c8e88e2c649be52542651b8cc
Reviewed-on: http://review.whamcloud.com/1885
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/ptlrpc/gss/gss_svc_upcall.c
lustre/utils/gss/context_lucid.c

index bf3ba8e..10fea4d 100644 (file)
@@ -1924,6 +1924,24 @@ LB_LINUX_TRY_COMPILE([
 
 # 2.6.32
 
+# 2.6.32 changes cache_detail's member cache_request to cache_upcall
+# in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe
+AC_DEFUN([LC_CACHE_UPCALL],
+[AC_MSG_CHECKING([if cache_detail has cache_upcall field])
+        LB_LINUX_TRY_COMPILE([
+                #include <linux/sunrpc/cache.h>
+        ],[
+                struct cache_detail cd;
+                cd.cache_upcall = NULL;
+        ],[
+                AC_MSG_RESULT(yes)
+                AC_DEFINE(HAVE_CACHE_UPCALL, 1,
+                          [cache_detail has cache_upcall field])
+        ],[
+                AC_MSG_RESULT(no)
+        ])
+])
+
 # 2.6.32 add a limits member in struct request_queue.
 AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
 [AC_MSG_CHECKING([if request_queue has a limits field])
@@ -2410,6 +2428,7 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_BLK_QUEUE_MAX_SECTORS
          LC_BLK_QUEUE_MAX_SEGMENTS
          LC_SET_CPUS_ALLOWED
+         LC_CACHE_UPCALL
 
          # 2.6.35
          LC_FILE_FSYNC
index 307f1ef..7622136 100644 (file)
@@ -181,6 +181,13 @@ static void rsi_request(struct cache_detail *cd,
         (*bpp)[-1] = '\n';
 }
 
+#ifdef HAVE_CACHE_UPCALL
+static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
+{
+        return sunrpc_cache_pipe_upcall(cd, h, rsi_request);
+}
+#endif
+
 static inline void __rsi_init(struct rsi *new, struct rsi *item)
 {
         new->out_handle = RAWOBJ_EMPTY;
@@ -472,7 +479,11 @@ static struct cache_detail rsi_cache = {
         .hash_table     = rsi_table,
         .name           = "auth.sptlrpc.init",
         .cache_put      = rsi_put,
+#ifdef HAVE_CACHE_UPCALL
+        .cache_upcall   = rsi_upcall,
+#else
         .cache_request  = rsi_request,
+#endif
         .cache_parse    = rsi_parse,
 #ifdef HAVE_SUNRPC_CACHE_V2
         .match          = rsi_match,
index c1f669f..6c5e672 100644 (file)
@@ -85,7 +85,7 @@ prepare_krb5_rfc1964_buffer(gss_krb5_lucid_context_v1_t *lctx,
 {
        char *p, *end;
        static int constant_zero = 0;
-       unsigned char fakeseed[16];
+       unsigned char fakeseed[16] = { 0 };
        uint32_t word_send_seq;
        gss_krb5_lucid_key_t enc_key;
        int i;