summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorPeng Tao <tao.peng@primarydata.com>2014-11-17 02:30:40 +0100
committerTom Haynes <loghyr@primarydata.com>2015-02-03 20:06:49 +0100
commit6c16605d6ef0dfb2e154119700d58b85c6b4dc71 (patch)
treec29cbc5029e0a21f0c40d6b2a5d9349bb258ca78 /fs/nfs/nfs4proc.c
parentnfs41: add range to layoutreturn args (diff)
downloadlinux-6c16605d6ef0dfb2e154119700d58b85c6b4dc71.tar.xz
linux-6c16605d6ef0dfb2e154119700d58b85c6b4dc71.zip
nfs41: allow async version layoutreturn
Signed-off-by: Peng Tao <tao.peng@primarydata.com> Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index e19b5dbe535a..2397c0f080d3 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7810,7 +7810,7 @@ static const struct rpc_call_ops nfs4_layoutreturn_call_ops = {
.rpc_release = nfs4_layoutreturn_release,
};
-int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp)
+int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp, bool sync)
{
struct rpc_task *task;
struct rpc_message msg = {
@@ -7824,16 +7824,23 @@ int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp)
.rpc_message = &msg,
.callback_ops = &nfs4_layoutreturn_call_ops,
.callback_data = lrp,
+ .flags = RPC_TASK_ASYNC,
};
- int status;
+ int status = 0;
dprintk("--> %s\n", __func__);
nfs4_init_sequence(&lrp->args.seq_args, &lrp->res.seq_res, 1);
task = rpc_run_task(&task_setup_data);
if (IS_ERR(task))
return PTR_ERR(task);
+ if (sync == false)
+ goto out;
+ status = nfs4_wait_for_completion_rpc_task(task);
+ if (status != 0)
+ goto out;
status = task->tk_status;
trace_nfs4_layoutreturn(lrp->args.inode, status);
+out:
dprintk("<-- %s status=%d\n", __func__, status);
rpc_put_task(task);
return status;