aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-14 15:39:58 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-19 15:21:39 -0400
commite4eff1a622edd6ab7b73acd5d8763aa2fa3fee49 (patch)
tree257d6675733d4af122a77054281e1d7d5062d904 /fs/nfs/dir.c
parent4fdc17b2a7f4d9db5b08e0f963d0027f714e4104 (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/dir.c')
-rw-r--r--fs/nfs/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 0fa1dbcdadb9..ea97408e423e 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -869,7 +869,7 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)
869 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { 869 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
870 lock_kernel(); 870 lock_kernel();
871 drop_nlink(inode); 871 drop_nlink(inode);
872 nfs_complete_unlink(dentry); 872 nfs_complete_unlink(dentry, inode);
873 unlock_kernel(); 873 unlock_kernel();
874 } 874 }
875 /* When creating a negative dentry, we want to renew d_time */ 875 /* When creating a negative dentry, we want to renew d_time */
@@ -1411,7 +1411,7 @@ static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
1411 nfs_renew_times(dentry); 1411 nfs_renew_times(dentry);
1412 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 1412 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
1413 d_move(dentry, sdentry); 1413 d_move(dentry, sdentry);
1414 error = nfs_async_unlink(dentry); 1414 error = nfs_async_unlink(dir, dentry);
1415 /* If we return 0 we don't unlink */ 1415 /* If we return 0 we don't unlink */
1416 } 1416 }
1417 dput(sdentry); 1417 dput(sdentry);