diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2006-08-22 20:06:21 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-09-22 23:24:51 -0400 |
commit | 9e1968c58d72c4b85d8a69bda1e194f9701fb224 (patch) | |
tree | ac19353824d0567f6986c505869810228dfaed64 /net | |
parent | ae5c79476f36512d1100e162606bb5691f2cce5a (diff) |
SUNRPC: Convert RPC portmapper to use new rpc_create() API
Replace xprt_create_proto/rpc_create_client calls in pmap_clnt.c with new
rpc_create() API.
Test plan:
Repeated runs of Connectathon locking suite. Check network trace for
proper PMAP calls and replies.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/pmap_clnt.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c index 523f0e825dea..f476f4df0f48 100644 --- a/net/sunrpc/pmap_clnt.c +++ b/net/sunrpc/pmap_clnt.c | |||
@@ -281,25 +281,22 @@ int rpc_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay) | |||
281 | 281 | ||
282 | static struct rpc_clnt *pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileged) | 282 | static struct rpc_clnt *pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileged) |
283 | { | 283 | { |
284 | struct rpc_xprt *xprt; | 284 | struct rpc_create_args args = { |
285 | struct rpc_clnt *clnt; | 285 | .protocol = proto, |
286 | 286 | .address = (struct sockaddr *)srvaddr, | |
287 | xprt = xprt_create_proto(proto, srvaddr, NULL); | 287 | .addrsize = sizeof(*srvaddr), |
288 | if (IS_ERR(xprt)) | 288 | .servername = hostname, |
289 | return (struct rpc_clnt *)xprt; | 289 | .program = &pmap_program, |
290 | xprt->ops->set_port(xprt, RPC_PMAP_PORT); | 290 | .version = RPC_PMAP_VERSION, |
291 | xprt_set_bound(xprt); | 291 | .authflavor = RPC_AUTH_UNIX, |
292 | .flags = (RPC_CLNT_CREATE_ONESHOT | | ||
293 | RPC_CLNT_CREATE_NOPING), | ||
294 | }; | ||
295 | |||
296 | srvaddr->sin_port = htons(RPC_PMAP_PORT); | ||
292 | if (!privileged) | 297 | if (!privileged) |
293 | xprt->resvport = 0; | 298 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; |
294 | 299 | return rpc_create(&args); | |
295 | clnt = rpc_new_client(xprt, hostname, | ||
296 | &pmap_program, RPC_PMAP_VERSION, | ||
297 | RPC_AUTH_UNIX); | ||
298 | if (!IS_ERR(clnt)) { | ||
299 | clnt->cl_softrtry = 1; | ||
300 | clnt->cl_oneshot = 1; | ||
301 | } | ||
302 | return clnt; | ||
303 | } | 300 | } |
304 | 301 | ||
305 | /* | 302 | /* |