aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/unlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/unlink.c')
-rw-r--r--fs/nfs/unlink.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
index 1494484ba86d..a65c7b53d558 100644
--- a/fs/nfs/unlink.c
+++ b/fs/nfs/unlink.c
@@ -87,10 +87,9 @@ nfs_copy_dname(struct dentry *dentry, struct nfs_unlinkdata *data)
87 * We delay initializing RPC info until after the call to dentry_iput() 87 * We delay initializing RPC info until after the call to dentry_iput()
88 * in order to minimize races against rename(). 88 * in order to minimize races against rename().
89 */ 89 */
90static void 90static void nfs_async_unlink_init(struct rpc_task *task, void *calldata)
91nfs_async_unlink_init(struct rpc_task *task)
92{ 91{
93 struct nfs_unlinkdata *data = (struct nfs_unlinkdata *)task->tk_calldata; 92 struct nfs_unlinkdata *data = calldata;
94 struct dentry *dir = data->dir; 93 struct dentry *dir = data->dir;
95 struct rpc_message msg = { 94 struct rpc_message msg = {
96 .rpc_cred = data->cred, 95 .rpc_cred = data->cred,
@@ -147,6 +146,7 @@ static void nfs_async_unlink_release(void *calldata)
147} 146}
148 147
149static const struct rpc_call_ops nfs_unlink_ops = { 148static const struct rpc_call_ops nfs_unlink_ops = {
149 .rpc_call_prepare = nfs_async_unlink_init,
150 .rpc_call_done = nfs_async_unlink_done, 150 .rpc_call_done = nfs_async_unlink_done,
151 .rpc_release = nfs_async_unlink_release, 151 .rpc_release = nfs_async_unlink_release,
152}; 152};
@@ -160,7 +160,6 @@ nfs_async_unlink(struct dentry *dentry)
160{ 160{
161 struct dentry *dir = dentry->d_parent; 161 struct dentry *dir = dentry->d_parent;
162 struct nfs_unlinkdata *data; 162 struct nfs_unlinkdata *data;
163 struct rpc_task *task;
164 struct rpc_clnt *clnt = NFS_CLIENT(dir->d_inode); 163 struct rpc_clnt *clnt = NFS_CLIENT(dir->d_inode);
165 int status = -ENOMEM; 164 int status = -ENOMEM;
166 165
@@ -181,15 +180,13 @@ nfs_async_unlink(struct dentry *dentry)
181 nfs_deletes = data; 180 nfs_deletes = data;
182 data->count = 1; 181 data->count = 1;
183 182
184 task = &data->task; 183 rpc_init_task(&data->task, clnt, RPC_TASK_ASYNC, &nfs_unlink_ops, data);
185 rpc_init_task(task, clnt, RPC_TASK_ASYNC, &nfs_unlink_ops, data);
186 task->tk_action = nfs_async_unlink_init;
187 184
188 spin_lock(&dentry->d_lock); 185 spin_lock(&dentry->d_lock);
189 dentry->d_flags |= DCACHE_NFSFS_RENAMED; 186 dentry->d_flags |= DCACHE_NFSFS_RENAMED;
190 spin_unlock(&dentry->d_lock); 187 spin_unlock(&dentry->d_lock);
191 188
192 rpc_sleep_on(&nfs_delete_queue, task, NULL, NULL); 189 rpc_sleep_on(&nfs_delete_queue, &data->task, NULL, NULL);
193 status = 0; 190 status = 0;
194 out: 191 out:
195 return status; 192 return status;