diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-14 15:39:58 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-19 15:21:39 -0400 |
commit | e4eff1a622edd6ab7b73acd5d8763aa2fa3fee49 (patch) | |
tree | 257d6675733d4af122a77054281e1d7d5062d904 /fs/nfs/proc.c | |
parent | 4fdc17b2a7f4d9db5b08e0f963d0027f714e4104 (diff) |
SUNRPC: Clean up the sillyrename code
Fix a couple of bugs:
- Don't rely on the parent dentry still being valid when the call completes.
Fixes a race with shrink_dcache_for_umount_subtree()
- Don't remove the file if the filehandle has been labelled as stale.
Fix a couple of inefficiencies
- Remove the global list of sillyrenamed files. Instead we can cache the
sillyrename information in the dentry->d_fsdata
- Move common code from unlink_setup/unlink_done into fs/nfs/unlink.c
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/proc.c')
-rw-r--r-- | fs/nfs/proc.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 3b3eb692e0f4..845cdde1d8b7 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -291,32 +291,16 @@ nfs_proc_remove(struct inode *dir, struct qstr *name) | |||
291 | return status; | 291 | return status; |
292 | } | 292 | } |
293 | 293 | ||
294 | static int | 294 | static void |
295 | nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *name) | 295 | nfs_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) |
296 | { | 296 | { |
297 | struct nfs_removeargs *arg; | ||
298 | |||
299 | arg = kmalloc(sizeof(*arg), GFP_KERNEL); | ||
300 | if (!arg) | ||
301 | return -ENOMEM; | ||
302 | arg->fh = NFS_FH(dir->d_inode); | ||
303 | arg->name.name = name->name; | ||
304 | arg->name.len = name->len; | ||
305 | msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE]; | 297 | msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE]; |
306 | msg->rpc_argp = arg; | ||
307 | return 0; | ||
308 | } | 298 | } |
309 | 299 | ||
310 | static int | 300 | static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir) |
311 | nfs_proc_unlink_done(struct dentry *dir, struct rpc_task *task) | ||
312 | { | 301 | { |
313 | struct rpc_message *msg = &task->tk_msg; | 302 | nfs_mark_for_revalidate(dir); |
314 | 303 | return 1; | |
315 | if (msg->rpc_argp) { | ||
316 | nfs_mark_for_revalidate(dir->d_inode); | ||
317 | kfree(msg->rpc_argp); | ||
318 | } | ||
319 | return 0; | ||
320 | } | 304 | } |
321 | 305 | ||
322 | static int | 306 | static int |