Skip to content

Commit

Permalink
dcache: d_find_alias needn't recheck IS_ROOT && DCACHE_DISCONNECTED
Browse files Browse the repository at this point in the history
If we get to this point and discover the dentry is not a root dentry, or
not DCACHE_DISCONNECTED--great, we always prefer that anyway.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
J. Bruce Fields authored and Al Viro committed Aug 7, 2014
1 parent 52ed46f commit 8d80d7d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,9 @@ static struct dentry *__d_find_alias(struct inode *inode)
alias = discon_alias;
spin_lock(&alias->d_lock);
if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
if (IS_ROOT(alias) &&
(alias->d_flags & DCACHE_DISCONNECTED)) {
__dget_dlock(alias);
spin_unlock(&alias->d_lock);
return alias;
}
__dget_dlock(alias);
spin_unlock(&alias->d_lock);
return alias;
}
spin_unlock(&alias->d_lock);
goto again;
Expand Down

0 comments on commit 8d80d7d

Please sign in to comment.