X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fptlrpc%2Fgss%2Fgss_internal.h;h=84ab236c687b895c21c7c822f24931624a590ee7;hp=bf93e652bb5aa57dc50f0159fcbf5981001c1bee;hb=cc759278f18f81d2325dc703be55750cb80ae51e;hpb=cf57dfc4c9bf4b9d36e356d6f33550676b21e066 diff --git a/lustre/ptlrpc/gss/gss_internal.h b/lustre/ptlrpc/gss/gss_internal.h index bf93e65..84ab236 100644 --- a/lustre/ptlrpc/gss/gss_internal.h +++ b/lustre/ptlrpc/gss/gss_internal.h @@ -3,7 +3,7 @@ * * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2016, Intel Corporation. * * Author: Eric Mei */ @@ -11,6 +11,7 @@ #ifndef __PTLRPC_GSS_GSS_INTERNAL_H_ #define __PTLRPC_GSS_GSS_INTERNAL_H_ +#include #include /* @@ -71,17 +72,16 @@ int buffer_extract_bytes(const void **buf, __u32 *buflen, */ #define GSS_GC_INTERVAL (60 * 60) /* 60 minutes */ -static inline -unsigned long gss_round_ctx_expiry(unsigned long expiry, - unsigned long sec_flags) +static inline time64_t gss_round_ctx_expiry(time64_t expiry, + unsigned long sec_flags) { - if (sec_flags & PTLRPC_SEC_FL_REVERSE) - return expiry; + if (sec_flags & PTLRPC_SEC_FL_REVERSE) + return expiry; - if (get_seconds() + __TIMEOUT_DELTA <= expiry) - return expiry - __TIMEOUT_DELTA; + if (ktime_get_real_seconds() + __TIMEOUT_DELTA <= expiry) + return expiry - __TIMEOUT_DELTA; - return expiry; + return expiry; } /* @@ -92,7 +92,11 @@ unsigned long gss_round_ctx_expiry(unsigned long expiry, /* * XXX make it visible of kernel and lgssd/lsvcgssd */ -#define GSSD_INTERFACE_VERSION (1) +enum { + GSSD_INTERFACE_VERSION_V1 = 1, + GSSD_INTERFACE_VERSION_V2 = 2, + GSSD_INTERFACE_VERSION = GSSD_INTERFACE_VERSION_V2, +}; #define PTLRPC_GSS_VERSION (1) @@ -470,7 +474,7 @@ __u32 g_verify_token_header(rawobj_t *mech, int *body_size, /* gss_cli_upcall.c */ -int gss_do_ctx_init_rpc(char *buffer, unsigned long count); +int gss_do_ctx_init_rpc(char __user *buffer, unsigned long count); int gss_do_ctx_fini_rpc(struct gss_cli_ctx *gctx); int __init gss_init_cli_upcall(void); @@ -515,8 +519,13 @@ int __init init_kerberos_module(void); void cleanup_kerberos_module(void); /* gss_sk_mech.c */ +#ifdef HAVE_OPENSSL_SSK int __init init_sk_module(void); void cleanup_sk_module(void); +#else +static inline int init_sk_module(void) { return 0; } +static inline void cleanup_sk_module(void) { return; } +#endif /* HAVE_OPENSSL_SSK */ /* debug */ static inline