btrfs: remove unnecessary dentry_unhash in rmdir/rename_dir
authorSage Weil <[email protected]>
Tue, 24 May 2011 20:06:15 +0000 (13:06 -0700)
committerAl Viro <[email protected]>
Thu, 26 May 2011 11:26:54 +0000 (07:26 -0400)
Btrfs has no problems with lingering references to unlinked directory
inodes.

CC: Chris Mason <[email protected]>
CC: [email protected]
Signed-off-by: Sage Weil <[email protected]>
Signed-off-by: Al Viro <[email protected]>
fs/btrfs/inode.c

index 3a33ae3ace5b1d3618ba7e7d8bd0229bc4943bdb..7cd8ab0ef04d5b3e95ccd572f96ca858457e8c18 100644 (file)
@@ -3062,8 +3062,6 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
            inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
                return -ENOTEMPTY;
 
-       dentry_unhash(dentry);
-
        trans = __unlink_start_trans(dir, dentry);
        if (IS_ERR(trans))
                return PTR_ERR(trans);
@@ -6994,9 +6992,6 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        u64 root_objectid;
        int ret;
 
-       if (new_inode && S_ISDIR(new_dentry->d_inode->i_mode))
-               dentry_unhash(new_dentry);
-
        if (new_dir->i_ino == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)
                return -EPERM;