diff options
Diffstat (limited to 'fs/nfs/unlink.c')
-rw-r--r-- | fs/nfs/unlink.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c index d639d172d568..1494484ba86d 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c | |||
@@ -116,10 +116,9 @@ nfs_async_unlink_init(struct rpc_task *task) | |||
116 | * | 116 | * |
117 | * Do the directory attribute update. | 117 | * Do the directory attribute update. |
118 | */ | 118 | */ |
119 | static void | 119 | static void nfs_async_unlink_done(struct rpc_task *task, void *calldata) |
120 | nfs_async_unlink_done(struct rpc_task *task) | ||
121 | { | 120 | { |
122 | struct nfs_unlinkdata *data = (struct nfs_unlinkdata *)task->tk_calldata; | 121 | struct nfs_unlinkdata *data = calldata; |
123 | struct dentry *dir = data->dir; | 122 | struct dentry *dir = data->dir; |
124 | struct inode *dir_i; | 123 | struct inode *dir_i; |
125 | 124 | ||
@@ -141,13 +140,17 @@ nfs_async_unlink_done(struct rpc_task *task) | |||
141 | * We need to call nfs_put_unlinkdata as a 'tk_release' task since the | 140 | * We need to call nfs_put_unlinkdata as a 'tk_release' task since the |
142 | * rpc_task would be freed too. | 141 | * rpc_task would be freed too. |
143 | */ | 142 | */ |
144 | static void | 143 | static void nfs_async_unlink_release(void *calldata) |
145 | nfs_async_unlink_release(struct rpc_task *task) | ||
146 | { | 144 | { |
147 | struct nfs_unlinkdata *data = (struct nfs_unlinkdata *)task->tk_calldata; | 145 | struct nfs_unlinkdata *data = calldata; |
148 | nfs_put_unlinkdata(data); | 146 | nfs_put_unlinkdata(data); |
149 | } | 147 | } |
150 | 148 | ||
149 | static const struct rpc_call_ops nfs_unlink_ops = { | ||
150 | .rpc_call_done = nfs_async_unlink_done, | ||
151 | .rpc_release = nfs_async_unlink_release, | ||
152 | }; | ||
153 | |||
151 | /** | 154 | /** |
152 | * nfs_async_unlink - asynchronous unlinking of a file | 155 | * nfs_async_unlink - asynchronous unlinking of a file |
153 | * @dentry: dentry to unlink | 156 | * @dentry: dentry to unlink |
@@ -179,10 +182,8 @@ nfs_async_unlink(struct dentry *dentry) | |||
179 | data->count = 1; | 182 | data->count = 1; |
180 | 183 | ||
181 | task = &data->task; | 184 | task = &data->task; |
182 | rpc_init_task(task, clnt, nfs_async_unlink_done , RPC_TASK_ASYNC); | 185 | rpc_init_task(task, clnt, RPC_TASK_ASYNC, &nfs_unlink_ops, data); |
183 | task->tk_calldata = data; | ||
184 | task->tk_action = nfs_async_unlink_init; | 186 | task->tk_action = nfs_async_unlink_init; |
185 | task->tk_release = nfs_async_unlink_release; | ||
186 | 187 | ||
187 | spin_lock(&dentry->d_lock); | 188 | spin_lock(&dentry->d_lock); |
188 | dentry->d_flags |= DCACHE_NFSFS_RENAMED; | 189 | dentry->d_flags |= DCACHE_NFSFS_RENAMED; |