aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2006-08-22 20:06:20 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-22 23:24:50 -0400
commit41877d207c46f050b709f452703ade20c3b4a096 (patch)
treea0da315e01e6008823dcc46c602e13c550a085a8 /fs
parente1ec78928b4d5a31b7a847e65c6009f4229f7c0f (diff)
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: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/client.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 471d975e63c3..12941a8a6d75 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -401,8 +401,17 @@ static int nfs_create_rpc_client(struct nfs_client *clp, int proto,
401 rpc_authflavor_t flavor) 401 rpc_authflavor_t flavor)
402{ 402{
403 struct rpc_timeout timeparms; 403 struct rpc_timeout timeparms;
404 struct rpc_xprt *xprt = NULL;
405 struct rpc_clnt *clnt = NULL; 404 struct rpc_clnt *clnt = NULL;
405 struct rpc_create_args args = {
406 .protocol = proto,
407 .address = (struct sockaddr *)&clp->cl_addr,
408 .addrsize = sizeof(clp->cl_addr),
409 .timeout = &timeparms,
410 .servername = clp->cl_hostname,
411 .program = &nfs_program,
412 .version = clp->rpc_ops->version,
413 .authflavor = flavor,
414 };
406 415
407 if (!IS_ERR(clp->cl_rpcclient)) 416 if (!IS_ERR(clp->cl_rpcclient))
408 return 0; 417 return 0;
@@ -411,27 +420,13 @@ static int nfs_create_rpc_client(struct nfs_client *clp, int proto,
411 clp->retrans_timeo = timeparms.to_initval; 420 clp->retrans_timeo = timeparms.to_initval;
412 clp->retrans_count = timeparms.to_retries; 421 clp->retrans_count = timeparms.to_retries;
413 422
414 /* create transport and client */ 423 clnt = rpc_create(&args);
415 xprt = xprt_create_proto(proto, &clp->cl_addr, &timeparms);
416 if (IS_ERR(xprt)) {
417 dprintk("%s: cannot create RPC transport. Error = %ld\n",
418 __FUNCTION__, PTR_ERR(xprt));
419 return PTR_ERR(xprt);
420 }
421
422 /* Bind to a reserved port! */
423 xprt->resvport = 1;
424 /* Create the client RPC handle */
425 clnt = rpc_create_client(xprt, clp->cl_hostname, &nfs_program,
426 clp->rpc_ops->version, RPC_AUTH_UNIX);
427 if (IS_ERR(clnt)) { 424 if (IS_ERR(clnt)) {
428 dprintk("%s: cannot create RPC client. Error = %ld\n", 425 dprintk("%s: cannot create RPC client. Error = %ld\n",
429 __FUNCTION__, PTR_ERR(clnt)); 426 __FUNCTION__, PTR_ERR(clnt));
430 return PTR_ERR(clnt); 427 return PTR_ERR(clnt);
431 } 428 }
432 429
433 clnt->cl_intr = 1;
434 clnt->cl_softrtry = 1;
435 clp->cl_rpcclient = clnt; 430 clp->cl_rpcclient = clnt;
436 return 0; 431 return 0;
437} 432}