diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 3d5d3c07d621..368b75b3bcba 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -195,14 +195,13 @@ static void update_changeattr(struct inode *inode, struct nfs4_change_info *cinf | |||
195 | } | 195 | } |
196 | 196 | ||
197 | /* Helper for asynchronous RPC calls */ | 197 | /* Helper for asynchronous RPC calls */ |
198 | static int nfs4_call_async(struct rpc_clnt *clnt, rpc_action tk_begin, | 198 | static int nfs4_call_async(struct rpc_clnt *clnt, |
199 | const struct rpc_call_ops *tk_ops, void *calldata) | 199 | const struct rpc_call_ops *tk_ops, void *calldata) |
200 | { | 200 | { |
201 | struct rpc_task *task; | 201 | struct rpc_task *task; |
202 | 202 | ||
203 | if (!(task = rpc_new_task(clnt, RPC_TASK_ASYNC, tk_ops, calldata))) | 203 | if (!(task = rpc_new_task(clnt, RPC_TASK_ASYNC, tk_ops, calldata))) |
204 | return -ENOMEM; | 204 | return -ENOMEM; |
205 | task->tk_action = tk_begin; | ||
206 | rpc_execute(task); | 205 | rpc_execute(task); |
207 | return 0; | 206 | return 0; |
208 | } | 207 | } |
@@ -882,6 +881,8 @@ static void nfs4_close_done(struct rpc_task *task, void *data) | |||
882 | struct nfs4_state *state = calldata->state; | 881 | struct nfs4_state *state = calldata->state; |
883 | struct nfs_server *server = NFS_SERVER(calldata->inode); | 882 | struct nfs_server *server = NFS_SERVER(calldata->inode); |
884 | 883 | ||
884 | if (RPC_ASSASSINATED(task)) | ||
885 | return; | ||
885 | /* hmm. we are done with the inode, and in the process of freeing | 886 | /* hmm. we are done with the inode, and in the process of freeing |
886 | * the state_owner. we keep this around to process errors | 887 | * the state_owner. we keep this around to process errors |
887 | */ | 888 | */ |
@@ -904,9 +905,9 @@ static void nfs4_close_done(struct rpc_task *task, void *data) | |||
904 | nfs_refresh_inode(calldata->inode, calldata->res.fattr); | 905 | nfs_refresh_inode(calldata->inode, calldata->res.fattr); |
905 | } | 906 | } |
906 | 907 | ||
907 | static void nfs4_close_begin(struct rpc_task *task) | 908 | static void nfs4_close_prepare(struct rpc_task *task, void *data) |
908 | { | 909 | { |
909 | struct nfs4_closedata *calldata = (struct nfs4_closedata *)task->tk_calldata; | 910 | struct nfs4_closedata *calldata = data; |
910 | struct nfs4_state *state = calldata->state; | 911 | struct nfs4_state *state = calldata->state; |
911 | struct rpc_message msg = { | 912 | struct rpc_message msg = { |
912 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE], | 913 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE], |
@@ -944,6 +945,7 @@ static void nfs4_close_begin(struct rpc_task *task) | |||
944 | } | 945 | } |
945 | 946 | ||
946 | static const struct rpc_call_ops nfs4_close_ops = { | 947 | static const struct rpc_call_ops nfs4_close_ops = { |
948 | .rpc_call_prepare = nfs4_close_prepare, | ||
947 | .rpc_call_done = nfs4_close_done, | 949 | .rpc_call_done = nfs4_close_done, |
948 | .rpc_release = nfs4_free_closedata, | 950 | .rpc_release = nfs4_free_closedata, |
949 | }; | 951 | }; |
@@ -980,8 +982,7 @@ int nfs4_do_close(struct inode *inode, struct nfs4_state *state) | |||
980 | calldata->res.fattr = &calldata->fattr; | 982 | calldata->res.fattr = &calldata->fattr; |
981 | calldata->res.server = server; | 983 | calldata->res.server = server; |
982 | 984 | ||
983 | status = nfs4_call_async(server->client, nfs4_close_begin, | 985 | status = nfs4_call_async(server->client, &nfs4_close_ops, calldata); |
984 | &nfs4_close_ops, calldata); | ||
985 | if (status == 0) | 986 | if (status == 0) |
986 | goto out; | 987 | goto out; |
987 | 988 | ||
@@ -2909,9 +2910,9 @@ static void nfs4_locku_done(struct rpc_task *task, void *data) | |||
2909 | } | 2910 | } |
2910 | } | 2911 | } |
2911 | 2912 | ||
2912 | static void nfs4_locku_begin(struct rpc_task *task) | 2913 | static void nfs4_locku_prepare(struct rpc_task *task, void *data) |
2913 | { | 2914 | { |
2914 | struct nfs4_unlockdata *calldata = (struct nfs4_unlockdata *)task->tk_calldata; | 2915 | struct nfs4_unlockdata *calldata = data; |
2915 | struct rpc_message msg = { | 2916 | struct rpc_message msg = { |
2916 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOCKU], | 2917 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOCKU], |
2917 | .rpc_argp = &calldata->arg, | 2918 | .rpc_argp = &calldata->arg, |
@@ -2932,6 +2933,7 @@ static void nfs4_locku_begin(struct rpc_task *task) | |||
2932 | } | 2933 | } |
2933 | 2934 | ||
2934 | static const struct rpc_call_ops nfs4_locku_ops = { | 2935 | static const struct rpc_call_ops nfs4_locku_ops = { |
2936 | .rpc_call_prepare = nfs4_locku_prepare, | ||
2935 | .rpc_call_done = nfs4_locku_done, | 2937 | .rpc_call_done = nfs4_locku_done, |
2936 | .rpc_release = nfs4_locku_complete, | 2938 | .rpc_release = nfs4_locku_complete, |
2937 | }; | 2939 | }; |
@@ -2979,8 +2981,7 @@ static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock * | |||
2979 | atomic_set(&calldata->refcount, 2); | 2981 | atomic_set(&calldata->refcount, 2); |
2980 | init_completion(&calldata->completion); | 2982 | init_completion(&calldata->completion); |
2981 | 2983 | ||
2982 | status = nfs4_call_async(NFS_SERVER(inode)->client, nfs4_locku_begin, | 2984 | status = nfs4_call_async(NFS_SERVER(inode)->client, &nfs4_locku_ops, calldata); |
2983 | &nfs4_locku_ops, calldata); | ||
2984 | if (status == 0) | 2985 | if (status == 0) |
2985 | wait_for_completion_interruptible(&calldata->completion); | 2986 | wait_for_completion_interruptible(&calldata->completion); |
2986 | do_vfs_lock(request->fl_file, request); | 2987 | do_vfs_lock(request->fl_file, request); |