Whamcloud - gitweb
LU-2800 auotconf: remove linux key-type.h test
[fs/lustre-release.git] / lustre / ptlrpc / gss / gss_keyring.c
index 5abc75c..05a1b0f 100644 (file)
@@ -48,9 +48,7 @@
 #include <linux/crypto.h>
 #include <linux/key.h>
 #include <linux/keyctl.h>
-#ifdef HAVE_LINUX_KEYTYPE_H
 #include <linux/key-type.h>
-#endif
 #include <linux/mutex.h>
 #include <asm/atomic.h>
 #else
@@ -123,13 +121,8 @@ static int sec_install_rctx_kr(struct ptlrpc_sec *sec,
              );                                                         \
 }
 
-#ifdef HAVE_STRUCT_CRED                /* Since 2.6.29 */
 #define key_cred(tsk)   ((tsk)->cred)
 #define key_tgcred(tsk) ((tsk)->cred->tgcred)
-#else
-#define key_cred(tsk)    (tsk)
-#define key_tgcred(tsk) ((tsk)->signal)
-#endif
 
 static inline void keyring_upcall_lock(struct gss_sec_keyring *gsec_kr)
 {
@@ -163,23 +156,22 @@ static void ctx_upcall_timeout_kr(unsigned long data)
         key_revoke_locked(key);
 }
 
-static
-void ctx_start_timer_kr(struct ptlrpc_cli_ctx *ctx, long timeout)
+static void ctx_start_timer_kr(struct ptlrpc_cli_ctx *ctx, long timeout)
 {
-        struct gss_cli_ctx_keyring *gctx_kr = ctx2gctx_keyring(ctx);
-        struct timer_list          *timer = gctx_kr->gck_timer;
+       struct gss_cli_ctx_keyring *gctx_kr = ctx2gctx_keyring(ctx);
+       struct timer_list          *timer = gctx_kr->gck_timer;
 
-        LASSERT(timer);
+       LASSERT(timer);
 
-        CDEBUG(D_SEC, "ctx %p: start timer %lds\n", ctx, timeout);
-        timeout = timeout * CFS_HZ + cfs_time_current();
+       CDEBUG(D_SEC, "ctx %p: start timer %lds\n", ctx, timeout);
+       timeout = timeout * HZ + cfs_time_current();
 
-        init_timer(timer);
-        timer->expires = timeout;
-        timer->data = (unsigned long ) ctx;
-        timer->function = ctx_upcall_timeout_kr;
+       init_timer(timer);
+       timer->expires = timeout;
+       timer->data = (unsigned long ) ctx;
+       timer->function = ctx_upcall_timeout_kr;
 
-        add_timer(timer);
+       add_timer(timer);
 }
 
 /*
@@ -1253,15 +1245,15 @@ int gss_kt_instantiate(struct key *key, const void *data, size_t datalen)
          * the session keyring is created upon upcall, and don't change all
          * the way until upcall finished, so rcu lock is not needed here.
          */
-       LASSERT(key_tgcred(cfs_current())->session_keyring);
+       LASSERT(key_tgcred(current)->session_keyring);
 
        lockdep_off();
-       rc = key_link(key_tgcred(cfs_current())->session_keyring, key);
+       rc = key_link(key_tgcred(current)->session_keyring, key);
        lockdep_on();
        if (unlikely(rc)) {
                CERROR("failed to link key %08x to keyring %08x: %d\n",
                       key->serial,
-                      key_tgcred(cfs_current())->session_keyring->serial, rc);
+                      key_tgcred(current)->session_keyring->serial, rc);
                RETURN(rc);
        }