]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sunrpc/auth.c
SUNRPC: TCP clear XPRT_CLOSE_WAIT when the socket is closed for writes
[linux-2.6-omap-h63xx.git] / net / sunrpc / auth.c
index 81f4c776c558ef0ebe49318a1435acc5685ac06e..1ea27559b1deb43dbeb9613fc3c9c501ef6aa942 100644 (file)
@@ -371,7 +371,7 @@ EXPORT_SYMBOL(rpcauth_init_cred);
 struct rpc_cred *
 rpcauth_bindcred(struct rpc_task *task)
 {
-       struct rpc_auth *auth = task->tk_auth;
+       struct rpc_auth *auth = task->tk_client->cl_auth;
        struct auth_cred acred = {
                .uid = current->fsuid,
                .gid = current->fsgid,
@@ -381,7 +381,7 @@ rpcauth_bindcred(struct rpc_task *task)
        int flags = 0;
 
        dprintk("RPC: %5u looking up %s cred\n",
-               task->tk_pid, task->tk_auth->au_ops->au_name);
+               task->tk_pid, task->tk_client->cl_auth->au_ops->au_name);
        get_group_info(acred.group_info);
        if (task->tk_flags & RPC_TASK_ROOTCREDS)
                flags |= RPCAUTH_LOOKUP_ROOTCREDS;
@@ -397,11 +397,12 @@ rpcauth_bindcred(struct rpc_task *task)
 void
 rpcauth_holdcred(struct rpc_task *task)
 {
-       dprintk("RPC: %5u holding %s cred %p\n",
-               task->tk_pid, task->tk_auth->au_ops->au_name,
-               task->tk_msg.rpc_cred);
-       if (task->tk_msg.rpc_cred)
-               get_rpccred(task->tk_msg.rpc_cred);
+       struct rpc_cred *cred = task->tk_msg.rpc_cred;
+       if (cred != NULL) {
+               get_rpccred(cred);
+               dprintk("RPC: %5u holding %s cred %p\n", task->tk_pid,
+                               cred->cr_auth->au_ops->au_name, cred);
+       }
 }
 
 void
@@ -441,7 +442,7 @@ rpcauth_unbindcred(struct rpc_task *task)
        struct rpc_cred *cred = task->tk_msg.rpc_cred;
 
        dprintk("RPC: %5u releasing %s cred %p\n",
-               task->tk_pid, task->tk_auth->au_ops->au_name, cred);
+               task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
 
        put_rpccred(cred);
        task->tk_msg.rpc_cred = NULL;
@@ -453,7 +454,7 @@ rpcauth_marshcred(struct rpc_task *task, __be32 *p)
        struct rpc_cred *cred = task->tk_msg.rpc_cred;
 
        dprintk("RPC: %5u marshaling %s cred %p\n",
-               task->tk_pid, task->tk_auth->au_ops->au_name, cred);
+               task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
 
        return cred->cr_ops->crmarshal(task, p);
 }
@@ -464,7 +465,7 @@ rpcauth_checkverf(struct rpc_task *task, __be32 *p)
        struct rpc_cred *cred = task->tk_msg.rpc_cred;
 
        dprintk("RPC: %5u validating %s cred %p\n",
-               task->tk_pid, task->tk_auth->au_ops->au_name, cred);
+               task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
 
        return cred->cr_ops->crvalidate(task, p);
 }
@@ -480,7 +481,7 @@ rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp,
        if (cred->cr_ops->crwrap_req)
                return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj);
        /* By default, we encode the arguments normally. */
-       return encode(rqstp, data, obj);
+       return rpc_call_xdrproc(encode, rqstp, data, obj);
 }
 
 int
@@ -495,7 +496,7 @@ rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp,
                return cred->cr_ops->crunwrap_resp(task, decode, rqstp,
                                                   data, obj);
        /* By default, we decode the arguments normally. */
-       return decode(rqstp, data, obj);
+       return rpc_call_xdrproc(decode, rqstp, data, obj);
 }
 
 int
@@ -505,7 +506,7 @@ rpcauth_refreshcred(struct rpc_task *task)
        int err;
 
        dprintk("RPC: %5u refreshing %s cred %p\n",
-               task->tk_pid, task->tk_auth->au_ops->au_name, cred);
+               task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
 
        err = cred->cr_ops->crrefresh(task);
        if (err < 0)
@@ -519,7 +520,7 @@ rpcauth_invalcred(struct rpc_task *task)
        struct rpc_cred *cred = task->tk_msg.rpc_cred;
 
        dprintk("RPC: %5u invalidating %s cred %p\n",
-               task->tk_pid, task->tk_auth->au_ops->au_name, cred);
+               task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
        if (cred)
                clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
 }
@@ -533,17 +534,18 @@ rpcauth_uptodatecred(struct rpc_task *task)
                test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0;
 }
 
-
-static struct shrinker *rpc_cred_shrinker;
+static struct shrinker rpc_cred_shrinker = {
+       .shrink = rpcauth_cache_shrinker,
+       .seeks = DEFAULT_SEEKS,
+};
 
 void __init rpcauth_init_module(void)
 {
        rpc_init_authunix();
-       rpc_cred_shrinker = set_shrinker(DEFAULT_SEEKS, rpcauth_cache_shrinker);
+       register_shrinker(&rpc_cred_shrinker);
 }
 
 void __exit rpcauth_remove_module(void)
 {
-       if (rpc_cred_shrinker != NULL)
-               remove_shrinker(rpc_cred_shrinker);
+       unregister_shrinker(&rpc_cred_shrinker);
 }