X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Fgss%2Fsec_gss.c;h=74eb47070a32cb61bdaa4049205089366a85f09f;hb=0aec97df129d2c6263c66454ee9039cd5dbfdf85;hp=10dfaab06444abb852ab74c1dc0d125f507c3082;hpb=65701b4a30efdb695776bcf690a2b3cabc928da1;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/gss/sec_gss.c b/lustre/ptlrpc/gss/sec_gss.c index 10dfaab..74eb470 100644 --- a/lustre/ptlrpc/gss/sec_gss.c +++ b/lustre/ptlrpc/gss/sec_gss.c @@ -1,11 +1,9 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * Modifications for Lustre * * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * - * Copyright (c) 2011, Whamcloud, Inc. + * Copyright (c) 2011, 2013, Intel Corporation. * * Author: Eric Mei */ @@ -48,9 +46,6 @@ * */ -#ifndef EXPORT_SYMTAB -# define EXPORT_SYMTAB -#endif #define DEBUG_SUBSYSTEM S_SEC #ifdef __KERNEL__ #include @@ -78,6 +73,7 @@ #include "gss_api.h" #include +#include /* * early reply have fixed size, respectively in privacy and integrity mode. @@ -336,9 +332,9 @@ int cli_ctx_expire(struct ptlrpc_cli_ctx *ctx) { LASSERT(cfs_atomic_read(&ctx->cc_refcount)); - if (!cfs_test_and_set_bit(PTLRPC_CTX_DEAD_BIT, &ctx->cc_flags)) { + if (!test_and_set_bit(PTLRPC_CTX_DEAD_BIT, &ctx->cc_flags)) { if (!ctx->cc_early_expire) - cfs_clear_bit(PTLRPC_CTX_UPTODATE_BIT, &ctx->cc_flags); + clear_bit(PTLRPC_CTX_UPTODATE_BIT, &ctx->cc_flags); CWARN("ctx %p(%u->%s) get expired: %lu(%+lds)\n", ctx, ctx->cc_vcred.vc_uid, sec2target_str(ctx->cc_sec), @@ -392,7 +388,7 @@ void gss_cli_ctx_uptodate(struct gss_cli_ctx *gctx) * someone else, in which case nobody will make further use * of it. we don't care, and mark it UPTODATE will help * destroying server side context when it be destroied. */ - cfs_set_bit(PTLRPC_CTX_UPTODATE_BIT, &ctx->cc_flags); + set_bit(PTLRPC_CTX_UPTODATE_BIT, &ctx->cc_flags); if (sec_is_reverse(ctx->cc_sec)) { CWARN("server installed reverse ctx %p idx "LPX64", " @@ -514,7 +510,7 @@ int gss_do_check_seq(unsigned long *window, __u32 win_size, __u32 *max_seq, */ switch (phase) { case 0: - if (cfs_test_bit(seq_num % win_size, window)) + if (test_bit(seq_num % win_size, window)) goto replay; break; case 1: @@ -544,9 +540,9 @@ replay: */ int gss_check_seq_num(struct gss_svc_seq_data *ssd, __u32 seq_num, int set) { - int rc = 0; + int rc = 0; - cfs_spin_lock(&ssd->ssd_lock); + spin_lock(&ssd->ssd_lock); if (set == 0) { /* @@ -580,8 +576,8 @@ int gss_check_seq_num(struct gss_svc_seq_data *ssd, __u32 seq_num, int set) gss_stat_oos_record_svc(2, 0); } exit: - cfs_spin_unlock(&ssd->ssd_lock); - return rc; + spin_unlock(&ssd->ssd_lock); + return rc; } /*************************************** @@ -1122,7 +1118,7 @@ int gss_sec_create_common(struct gss_sec *gsec, return -EOPNOTSUPP; } - cfs_spin_lock_init(&gsec->gs_lock); + spin_lock_init(&gsec->gs_lock); gsec->gs_rvs_hdl = 0ULL; /* initialize upper ptlrpc_sec */ @@ -1133,7 +1129,7 @@ int gss_sec_create_common(struct gss_sec *gsec, sec->ps_id = sptlrpc_get_next_secid(); sec->ps_flvr = *sf; sec->ps_import = class_import_get(imp); - cfs_spin_lock_init(&sec->ps_lock); + spin_lock_init(&sec->ps_lock); CFS_INIT_LIST_HEAD(&sec->ps_gc_list); if (!svcctx) { @@ -1197,7 +1193,7 @@ int gss_cli_ctx_init_common(struct ptlrpc_sec *sec, ctx->cc_expire = 0; ctx->cc_flags = PTLRPC_CTX_NEW; ctx->cc_vcred = *vcred; - cfs_spin_lock_init(&ctx->cc_lock); + spin_lock_init(&ctx->cc_lock); CFS_INIT_LIST_HEAD(&ctx->cc_req_list); CFS_INIT_LIST_HEAD(&ctx->cc_gc_chain);