Commit 9e1968c5 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent ae5c7947
...@@ -281,25 +281,22 @@ int rpc_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay) ...@@ -281,25 +281,22 @@ int rpc_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay)
static struct rpc_clnt *pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileged) static struct rpc_clnt *pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileged)
{ {
struct rpc_xprt *xprt; struct rpc_create_args args = {
struct rpc_clnt *clnt; .protocol = proto,
.address = (struct sockaddr *)srvaddr,
xprt = xprt_create_proto(proto, srvaddr, NULL); .addrsize = sizeof(*srvaddr),
if (IS_ERR(xprt)) .servername = hostname,
return (struct rpc_clnt *)xprt; .program = &pmap_program,
xprt->ops->set_port(xprt, RPC_PMAP_PORT); .version = RPC_PMAP_VERSION,
xprt_set_bound(xprt); .authflavor = RPC_AUTH_UNIX,
.flags = (RPC_CLNT_CREATE_ONESHOT |
RPC_CLNT_CREATE_NOPING),
};
srvaddr->sin_port = htons(RPC_PMAP_PORT);
if (!privileged) if (!privileged)
xprt->resvport = 0; args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
return rpc_create(&args);
clnt = rpc_new_client(xprt, hostname,
&pmap_program, RPC_PMAP_VERSION,
RPC_AUTH_UNIX);
if (!IS_ERR(clnt)) {
clnt->cl_softrtry = 1;
clnt->cl_oneshot = 1;
}
return clnt;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment