#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
); \
}
-#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)
{
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);
}
/*
* 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);
}