aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2009-12-03 15:58:56 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-12-03 15:58:56 -0500
commit24e93025ee434a58d35e5abb283c5bcc9a13e477 (patch)
treef187100fdb63afb537e209c62e9c6bb5a95fc46b /fs
parent27226104e60964f21717e0f452cecd45c85a64c6 (diff)
nfs: clean up sillyrenaming in nfs_rename()
The d_instantiate(new_dentry, NULL) is superfluous, the dentry is already negative. Rehashing this dummy dentry isn't needed either, d_move() works fine on an unhashed target. The re-checking for busy after a failed nfs_sillyrename() is bogus too: new_dentry->d_count < 2 would be a bug here. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/dir.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 76b7f539d76e..2c5ace4f00a7 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1611,14 +1611,11 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1611 1611
1612 /* silly-rename the existing target ... */ 1612 /* silly-rename the existing target ... */
1613 err = nfs_sillyrename(new_dir, new_dentry); 1613 err = nfs_sillyrename(new_dir, new_dentry);
1614 if (!err) { 1614 if (err)
1615 new_dentry = rehash = dentry;
1616 new_inode = NULL;
1617 /* instantiate the replacement target */
1618 d_instantiate(new_dentry, NULL);
1619 } else if (atomic_read(&new_dentry->d_count) > 1)
1620 /* dentry still busy? */
1621 goto out; 1615 goto out;
1616
1617 new_dentry = dentry;
1618 new_inode = NULL;
1622 } 1619 }
1623 } 1620 }
1624 1621