diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-03-17 22:05:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-03-17 22:05:47 +0000 |
commit | 27cfca1ec98e91261b1a5355d10a8996464b63af (patch) | |
tree | 8e895a53e372fa682b4c0a585b9377d67ed70d0e /net/sunrpc/clnt.c | |
parent | 6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff) |
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too
o Upgrade to 2.1.89.
Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 67 |
1 files changed, 26 insertions, 41 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 7abaa691e..e8ca9a511 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -21,9 +21,6 @@ * Copyright (C) 1995,1996 Olaf Kirch <okir@monad.swb.de> */ -#include <linux/config.h> -#include <linux/module.h> - #include <asm/system.h> #include <asm/segment.h> @@ -72,20 +69,19 @@ rpc_create_client(struct rpc_xprt *xprt, char *servname, struct rpc_program *program, u32 vers, int flavor) { struct rpc_version *version; - struct rpc_clnt *clnt; + struct rpc_clnt *clnt = NULL; dprintk("RPC: creating %s client for %s (xprt %p)\n", - program->name, servname, xprt); + program->name, servname, xprt); if (!xprt) - return NULL; - if (vers>= program->nrvers || !(version = program->version[vers])) - return NULL; + goto out; + if (vers >= program->nrvers || !(version = program->version[vers])) + goto out; - if (!(clnt = (struct rpc_clnt *) rpc_allocate(0, sizeof(*clnt)))) { - printk("RPC: out of memory in rpc_create_client\n"); - return NULL; - } + clnt = (struct rpc_clnt *) rpc_allocate(0, sizeof(*clnt)); + if (!clnt) + goto out_no_clnt; memset(clnt, 0, sizeof(*clnt)); clnt->cl_xprt = xprt; @@ -103,13 +99,20 @@ rpc_create_client(struct rpc_xprt *xprt, char *servname, if (!clnt->cl_port) clnt->cl_autobind = 1; - if (!rpcauth_create(flavor, clnt)) { - printk("RPC: Couldn't create auth handle (flavor %d)\n", - flavor); - rpc_free(clnt); - return NULL; - } + if (!rpcauth_create(flavor, clnt)) + goto out_no_auth; +out: return clnt; + +out_no_clnt: + printk("RPC: out of memory in rpc_create_client\n"); + goto out; +out_no_auth: + printk("RPC: Couldn't create auth handle (flavor %d)\n", + flavor); + rpc_free(clnt); + clnt = NULL; + goto out; } /* @@ -753,8 +756,10 @@ call_verify(struct rpc_task *task) rpc_exit(task, error); return NULL; } - if (!(p = rpcauth_checkverf(task, p))) + if (!(p = rpcauth_checkverf(task, p))) { + printk("call_verify: auth check failed\n"); goto garbage; /* bad verifier, retry */ + } switch ((n = ntohl(*p++))) { case RPC_SUCCESS: return p; @@ -768,7 +773,8 @@ call_verify(struct rpc_task *task) garbage: dprintk("RPC: %4d call_verify: server saw garbage\n", task->tk_pid); task->tk_client->cl_stats->rpcgarbage++; - if (0 && task->tk_garb_retry--) { + if (task->tk_garb_retry--) { + printk("RPC: garbage, retrying %4d\n", task->tk_pid); task->tk_action = call_encode; return NULL; } @@ -776,24 +782,3 @@ garbage: rpc_exit(task, -EIO); return NULL; } - -#ifdef MODULE -int -init_module(void) -{ -#ifdef RPC_DEBUG - rpc_register_sysctl(); -#endif - rpc_proc_init(); - return 0; -} - -void -cleanup_module(void) -{ -#ifdef RPC_DEBUG - rpc_unregister_sysctl(); -#endif - rpc_proc_exit(); -} -#endif |