vserver 1.9.5.x5
[linux-2.6.git] / net / sunrpc / auth.c
index 2fd2975..5d13e7b 100644 (file)
@@ -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);
-}