Skip to content

Commit

Permalink
don't open-code d_rehash() in d_materialise_unique()
Browse files Browse the repository at this point in the history
... and get rid of duplicate BUG_ON() there

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Sep 27, 2014
1 parent 5cc3821 commit 8527dd7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2804,12 +2804,8 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
actual = __d_instantiate_unique(dentry, inode);
if (!actual)
actual = dentry;
else
BUG_ON(!d_unhashed(actual));

spin_lock(&actual->d_lock);
_d_rehash(actual);
spin_unlock(&actual->d_lock);
d_rehash(actual);
found:
spin_unlock(&inode->i_lock);
out_nolock:
Expand Down

0 comments on commit 8527dd7

Please sign in to comment.