[pnfs] [PATCH] nfs41: use rpc_call_sync in nfs4_proc_get_lease_time

Benny Halevy bhalevy at panasas.com
Fri Mar 14 07:14:22 EDT 2008


Current code abuses rpc_run_task while a synchronous rpc
seems to be all it needs to do.

Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfs/nfs4proc.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d0e9c5a..9270e7f 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4522,24 +4522,8 @@ int nfs4_proc_get_lease_time(struct nfs_client *clp,
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
-	struct rpc_task_setup task_setup = {
-		.rpc_client = session->clnt,
-		.rpc_message = &msg,
-		.callback_ops = &nfs4_get_lease_time_ops,
-		.callback_data = &data
-	};
-	int status;
-
-	task = rpc_run_task(&task_setup);
 
-	if (IS_ERR(task))
-		status = PTR_ERR(task);
-	else {
-		status = task->tk_status;
-		rpc_put_task(task);
-	}
-
-	return status;
+	return rpc_call_sync(clp->cl_rpcclient, &msg, 0);
 }
 
 /* Initialize a slot table */
-- 
1.5.3.3



More information about the pNFS mailing list