Commit 41877d20 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

NFS: Convert NFS client to use new rpc_create() API

Convert NFS client mount logic to use rpc_create() instead of the old
xprt_create_proto/rpc_create_client API.

Test plan:
Mount stress tests.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent e1ec7892
...@@ -401,8 +401,17 @@ static int nfs_create_rpc_client(struct nfs_client *clp, int proto, ...@@ -401,8 +401,17 @@ static int nfs_create_rpc_client(struct nfs_client *clp, int proto,
rpc_authflavor_t flavor) rpc_authflavor_t flavor)
{ {
struct rpc_timeout timeparms; struct rpc_timeout timeparms;
struct rpc_xprt *xprt = NULL;
struct rpc_clnt *clnt = NULL; struct rpc_clnt *clnt = NULL;
struct rpc_create_args args = {
.protocol = proto,
.address = (struct sockaddr *)&clp->cl_addr,
.addrsize = sizeof(clp->cl_addr),
.timeout = &timeparms,
.servername = clp->cl_hostname,
.program = &nfs_program,
.version = clp->rpc_ops->version,
.authflavor = flavor,
};
if (!IS_ERR(clp->cl_rpcclient)) if (!IS_ERR(clp->cl_rpcclient))
return 0; return 0;
...@@ -411,27 +420,13 @@ static int nfs_create_rpc_client(struct nfs_client *clp, int proto, ...@@ -411,27 +420,13 @@ static int nfs_create_rpc_client(struct nfs_client *clp, int proto,
clp->retrans_timeo = timeparms.to_initval; clp->retrans_timeo = timeparms.to_initval;
clp->retrans_count = timeparms.to_retries; clp->retrans_count = timeparms.to_retries;
/* create transport and client */ clnt = rpc_create(&args);
xprt = xprt_create_proto(proto, &clp->cl_addr, &timeparms);
if (IS_ERR(xprt)) {
dprintk("%s: cannot create RPC transport. Error = %ld\n",
__FUNCTION__, PTR_ERR(xprt));
return PTR_ERR(xprt);
}
/* Bind to a reserved port! */
xprt->resvport = 1;
/* Create the client RPC handle */
clnt = rpc_create_client(xprt, clp->cl_hostname, &nfs_program,
clp->rpc_ops->version, RPC_AUTH_UNIX);
if (IS_ERR(clnt)) { if (IS_ERR(clnt)) {
dprintk("%s: cannot create RPC client. Error = %ld\n", dprintk("%s: cannot create RPC client. Error = %ld\n",
__FUNCTION__, PTR_ERR(clnt)); __FUNCTION__, PTR_ERR(clnt));
return PTR_ERR(clnt); return PTR_ERR(clnt);
} }
clnt->cl_intr = 1;
clnt->cl_softrtry = 1;
clp->cl_rpcclient = clnt; clp->cl_rpcclient = clnt;
return 0; return 0;
} }
......
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