X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fsunrpc%2Fauth.c;h=5d13e7bc9be9cf0afc730fc7058996d9b0f6f50a;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=2fd2975c8f686eb6ed7dabad34cbbd71c0ff0f6f;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 2fd2975c8..5d13e7bc9 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -26,7 +26,7 @@ static struct rpc_authops * auth_flavors[RPC_AUTH_MAXFLAVOR] = { NULL, /* others can be loadable modules */ }; -u32 +static u32 pseudoflavor_to_flavor(u32 flavor) { if (flavor >= RPC_AUTH_MAXFLAVOR) return RPC_AUTH_GSS; @@ -90,7 +90,7 @@ rpcauth_destroy(struct rpc_auth *auth) kfree(auth); } -static spinlock_t rpc_credcache_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(rpc_credcache_lock); /* * Initialize RPC credential cache @@ -215,8 +215,6 @@ retry: list_for_each_safe(pos, next, &auth->au_credcache[nr]) { struct rpc_cred *entry; entry = list_entry(pos, struct rpc_cred, cr_hash); - if (entry->cr_flags & RPCAUTH_CRED_DEAD) - continue; if (rpcauth_prune_expired(entry, &free)) continue; if (entry->cr_ops->crmatch(acred, entry, taskflags)) { @@ -262,7 +260,7 @@ rpcauth_lookupcred(struct rpc_auth *auth, int taskflags) get_group_info(current->group_info); acred.uid = current->fsuid; acred.gid = current->fsgid; - acred.xid = current->xid; + acred.xid = vx_current_xid(); acred.group_info = current->group_info; dprintk("RPC: looking up %s cred\n", @@ -282,7 +280,7 @@ rpcauth_bindcred(struct rpc_task *task) get_group_info(current->group_info); acred.uid = current->fsuid; acred.gid = current->fsgid; - acred.xid = current->xid; + acred.xid = vx_current_xid(); acred.group_info = current->group_info; dprintk("RPC: %4d looking up %s cred\n", @@ -310,9 +308,6 @@ put_rpccred(struct rpc_cred *cred) if (!atomic_dec_and_lock(&cred->cr_count, &rpc_credcache_lock)) return; - if ((cred->cr_flags & RPCAUTH_CRED_DEAD) && !list_empty(&cred->cr_hash)) - list_del_init(&cred->cr_hash); - if (list_empty(&cred->cr_hash)) { spin_unlock(&rpc_credcache_lock); rpcauth_crdestroy(cred); @@ -416,10 +411,3 @@ rpcauth_uptodatecred(struct rpc_task *task) return !(task->tk_msg.rpc_cred) || (task->tk_msg.rpc_cred->cr_flags & RPCAUTH_CRED_UPTODATE); } - -int -rpcauth_deadcred(struct rpc_task *task) -{ - return !(task->tk_msg.rpc_cred) || - (task->tk_msg.rpc_cred->cr_flags & RPCAUTH_CRED_DEAD); -}