Skip to content

Commit e391178

Browse files
liewegasAl Viro
authored andcommitted
hfsplus: remove unnecessary dentry_unhash on rmdir, dir rename
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>
1 parent 4e82d61 commit e391178

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎fs/hfsplus/dir.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)
370370
struct inode *inode = dentry->d_inode;
371371
int res;
372372

373-
dentry_unhash(dentry);
374-
375373
if (inode->i_size != 2)
376374
return -ENOTEMPTY;
377375

@@ -469,12 +467,10 @@ static int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry,
469467

470468
/* Unlink destination if it already exists */
471469
if (new_dentry->d_inode) {
472-
if (S_ISDIR(new_dentry->d_inode->i_mode)) {
473-
dentry_unhash(new_dentry);
470+
if (S_ISDIR(new_dentry->d_inode->i_mode))
474471
res = hfsplus_rmdir(new_dir, new_dentry);
475-
} else {
472+
else
476473
res = hfsplus_unlink(new_dir, new_dentry);
477-
}
478474
if (res)
479475
return res;
480476
}

0 commit comments

Comments
 (0)