diff options
author | Peng Tao <tao.peng@primarydata.com> | 2014-11-16 20:30:40 -0500 |
---|---|---|
committer | Tom Haynes <loghyr@primarydata.com> | 2015-02-03 14:06:49 -0500 |
commit | 6c16605d6ef0dfb2e154119700d58b85c6b4dc71 (patch) | |
tree | c29cbc5029e0a21f0c40d6b2a5d9349bb258ca78 /fs/nfs/nfs4proc.c | |
parent | 15eb67c15342d212b0c8a540b6d6bd2dfad52a63 (diff) |
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.c | 11 |
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 = { | |||
7810 | .rpc_release = nfs4_layoutreturn_release, | 7810 | .rpc_release = nfs4_layoutreturn_release, |
7811 | }; | 7811 | }; |
7812 | 7812 | ||
7813 | int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp) | 7813 | int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp, bool sync) |
7814 | { | 7814 | { |
7815 | struct rpc_task *task; | 7815 | struct rpc_task *task; |
7816 | struct rpc_message msg = { | 7816 | struct rpc_message msg = { |
@@ -7824,16 +7824,23 @@ int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp) | |||
7824 | .rpc_message = &msg, | 7824 | .rpc_message = &msg, |
7825 | .callback_ops = &nfs4_layoutreturn_call_ops, | 7825 | .callback_ops = &nfs4_layoutreturn_call_ops, |
7826 | .callback_data = lrp, | 7826 | .callback_data = lrp, |
7827 | .flags = RPC_TASK_ASYNC, | ||
7827 | }; | 7828 | }; |
7828 | int status; | 7829 | int status = 0; |
7829 | 7830 | ||
7830 | dprintk("--> %s\n", __func__); | 7831 | dprintk("--> %s\n", __func__); |
7831 | nfs4_init_sequence(&lrp->args.seq_args, &lrp->res.seq_res, 1); | 7832 | nfs4_init_sequence(&lrp->args.seq_args, &lrp->res.seq_res, 1); |
7832 | task = rpc_run_task(&task_setup_data); | 7833 | task = rpc_run_task(&task_setup_data); |
7833 | if (IS_ERR(task)) | 7834 | if (IS_ERR(task)) |
7834 | return PTR_ERR(task); | 7835 | return PTR_ERR(task); |
7836 | if (sync == false) | ||
7837 | goto out; | ||
7838 | status = nfs4_wait_for_completion_rpc_task(task); | ||
7839 | if (status != 0) | ||
7840 | goto out; | ||
7835 | status = task->tk_status; | 7841 | status = task->tk_status; |
7836 | trace_nfs4_layoutreturn(lrp->args.inode, status); | 7842 | trace_nfs4_layoutreturn(lrp->args.inode, status); |
7843 | out: | ||
7837 | dprintk("<-- %s status=%d\n", __func__, status); | 7844 | dprintk("<-- %s status=%d\n", __func__, status); |
7838 | rpc_put_task(task); | 7845 | rpc_put_task(task); |
7839 | return status; | 7846 | return status; |