hfsplus: remove unnecessary dentry_unhash on rmdir, dir rename
authorSage Weil <sage@newdream.net>
Fri, 27 May 2011 20:42:06 +0000 (13:42 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 28 May 2011 05:02:52 +0000 (01:02 -0400)
hfsplus does not have problems with references to unlinked directories.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/hfsplus/dir.c

index b28835091dd084d9f1fae4709dafbc2cb1d7fc0b..4df5059c25da67c4b1ddd2a868057951e6e54d60 100644 (file)
@@ -370,8 +370,6 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)
        struct inode *inode = dentry->d_inode;
        int res;
 
-       dentry_unhash(dentry);
-
        if (inode->i_size != 2)
                return -ENOTEMPTY;
 
@@ -469,12 +467,10 @@ static int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry,
 
        /* Unlink destination if it already exists */
        if (new_dentry->d_inode) {
-               if (S_ISDIR(new_dentry->d_inode->i_mode)) {
-                       dentry_unhash(new_dentry);
+               if (S_ISDIR(new_dentry->d_inode->i_mode))
                        res = hfsplus_rmdir(new_dir, new_dentry);
-               } else {
+               else
                        res = hfsplus_unlink(new_dir, new_dentry);
-               }
                if (res)
                        return res;
        }