Commit f64f58f8 authored by Sage Weil's avatar Sage Weil Committed by Al Viro

btrfs: remove unnecessary dentry_unhash in rmdir/rename_dir

Btrfs has no problems with lingering references to unlinked directory
inodes.

CC: Chris Mason <chris.mason@oracle.com>
CC: linux-btrfs@vger.kernel.org
Signed-off-by: default avatarSage Weil <sage@newdream.net>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 051e8f0e
...@@ -3062,8 +3062,6 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -3062,8 +3062,6 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
return -ENOTEMPTY; return -ENOTEMPTY;
dentry_unhash(dentry);
trans = __unlink_start_trans(dir, dentry); trans = __unlink_start_trans(dir, dentry);
if (IS_ERR(trans)) if (IS_ERR(trans))
return PTR_ERR(trans); return PTR_ERR(trans);
...@@ -6994,9 +6992,6 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -6994,9 +6992,6 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
u64 root_objectid; u64 root_objectid;
int ret; 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) if (new_dir->i_ino == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)
return -EPERM; return -EPERM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment