aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/unlink.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-03 03:55:05 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-06 14:58:40 -0500
commit4ce70ada1ff1d0b80916ec9ec5764ce44a50a54f (patch)
tree9bc9ffc691679a4423a6b8724a27607c9ad7ea2c /fs/nfs/unlink.c
parent963d8fe53339128ee46a7701f2e36305f0ccff8c (diff)
SUNRPC: Further cleanups
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
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;