aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2006-08-22 20:06:15 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-22 23:24:39 -0400
commit4a68179d38874c37be2802442a71b847f5d1a2a9 (patch)
tree688b345744d182e303f96891d396a0ee1e43520a /net/sunrpc/clnt.c
parentec739ef03dc926d05051c8c5838971445504470a (diff)
SUNRPC: Make RPC portmapper use per-transport storage
Move connection and bind state that was maintained in the rpc_clnt structure to the rpc_xprt structure. This will allow the creation of a clean API for plugging in different types of bind mechanisms. This brings improvements such as the elimination of a single spin lock to control serialization for all in-kernel RPC binding. A set of per-xprt bitops is used to serialize tasks during RPC binding, just like it now works for making RPC transport connections. Test-plan: Destructive testing (unplugging the network temporarily). Connectathon with UDP and TCP. NFSv2/3 and NFSv4 mounting should be carefully checked. Probably need to rig a server where certain services aren't running, or that returns an error for some typical operation. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 0b8d03d08561..cee504162a3f 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -147,13 +147,10 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname,
147 clnt->cl_procinfo = version->procs; 147 clnt->cl_procinfo = version->procs;
148 clnt->cl_maxproc = version->nrprocs; 148 clnt->cl_maxproc = version->nrprocs;
149 clnt->cl_protname = program->name; 149 clnt->cl_protname = program->name;
150 clnt->cl_pmap = &clnt->cl_pmap_default;
151 clnt->cl_prog = program->number; 150 clnt->cl_prog = program->number;
152 clnt->cl_vers = version->number; 151 clnt->cl_vers = version->number;
153 clnt->cl_prot = xprt->prot;
154 clnt->cl_stats = program->stats; 152 clnt->cl_stats = program->stats;
155 clnt->cl_metrics = rpc_alloc_iostats(clnt); 153 clnt->cl_metrics = rpc_alloc_iostats(clnt);
156 rpc_init_wait_queue(&clnt->cl_pmap_default.pm_bindwait, "bindwait");
157 154
158 if (!xprt_bound(clnt->cl_xprt)) 155 if (!xprt_bound(clnt->cl_xprt))
159 clnt->cl_autobind = 1; 156 clnt->cl_autobind = 1;
@@ -243,8 +240,6 @@ rpc_clone_client(struct rpc_clnt *clnt)
243 atomic_set(&new->cl_users, 0); 240 atomic_set(&new->cl_users, 0);
244 new->cl_parent = clnt; 241 new->cl_parent = clnt;
245 atomic_inc(&clnt->cl_count); 242 atomic_inc(&clnt->cl_count);
246 /* Duplicate portmapper */
247 rpc_init_wait_queue(&new->cl_pmap_default.pm_bindwait, "bindwait");
248 /* Turn off autobind on clones */ 243 /* Turn off autobind on clones */
249 new->cl_autobind = 0; 244 new->cl_autobind = 0;
250 new->cl_oneshot = 0; 245 new->cl_oneshot = 0;
@@ -254,8 +249,7 @@ rpc_clone_client(struct rpc_clnt *clnt)
254 rpc_init_rtt(&new->cl_rtt_default, clnt->cl_xprt->timeout.to_initval); 249 rpc_init_rtt(&new->cl_rtt_default, clnt->cl_xprt->timeout.to_initval);
255 if (new->cl_auth) 250 if (new->cl_auth)
256 atomic_inc(&new->cl_auth->au_count); 251 atomic_inc(&new->cl_auth->au_count);
257 new->cl_pmap = &new->cl_pmap_default; 252 new->cl_metrics = rpc_alloc_iostats(clnt);
258 new->cl_metrics = rpc_alloc_iostats(clnt);
259 return new; 253 return new;
260out_no_clnt: 254out_no_clnt:
261 printk(KERN_INFO "RPC: out of memory in %s\n", __FUNCTION__); 255 printk(KERN_INFO "RPC: out of memory in %s\n", __FUNCTION__);