Skip to content

Commit

Permalink
omfs: remove unnecessary dentry_unhash on rmdir, dir rneame
Browse files Browse the repository at this point in the history
omfs does not have problems with references to unlinked directories.

CC: Bob Copeland <me@bobcopeland.com>
CC: linux-karma-devel@lists.sourceforge.net
Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Sage Weil authored and Al Viro committed May 28, 2011
1 parent 7020739 commit 8aaa0f5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions fs/omfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,9 @@ static int omfs_remove(struct inode *dir, struct dentry *dentry)
int ret;


if (S_ISDIR(inode->i_mode)) {
dentry_unhash(dentry);
if (!omfs_dir_is_empty(inode))
return -ENOTEMPTY;
}
if (S_ISDIR(inode->i_mode) &&
!omfs_dir_is_empty(inode))
return -ENOTEMPTY;

ret = omfs_delete_entry(dentry);
if (ret)
Expand Down Expand Up @@ -382,9 +380,6 @@ static int omfs_rename(struct inode *old_dir, struct dentry *old_dentry,
int err;

if (new_inode) {
if (S_ISDIR(new_inode->i_mode))
dentry_unhash(new_dentry);

/* overwriting existing file/dir */
err = omfs_remove(new_dir, new_dentry);
if (err)
Expand Down

0 comments on commit 8aaa0f5

Please sign in to comment.