staging: lustre: llite: remove directory-specific code from ll_find_alias()
Now that ll_find_alias() is never called for directories, we can remove code that only applies to directories. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e9d4f0b9f5
commit
ac63774689
|
@ -380,21 +380,15 @@ void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* try to reuse three types of dentry:
|
* Try to reuse unhashed or invalidated dentries.
|
||||||
* 1. unhashed alias, this one is unhashed by d_invalidate (but it may be valid
|
|
||||||
* by concurrent .revalidate).
|
|
||||||
* 2. INVALID alias (common case for no valid ldlm lock held, but this flag may
|
|
||||||
* be cleared by others calling d_lustre_revalidate).
|
|
||||||
* 3. DISCONNECTED alias.
|
|
||||||
*/
|
*/
|
||||||
static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
|
static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
|
||||||
{
|
{
|
||||||
struct dentry *alias, *discon_alias, *invalid_alias;
|
struct dentry *alias, *invalid_alias;
|
||||||
|
|
||||||
if (hlist_empty(&inode->i_dentry))
|
if (hlist_empty(&inode->i_dentry))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
discon_alias = NULL;
|
|
||||||
invalid_alias = NULL;
|
invalid_alias = NULL;
|
||||||
|
|
||||||
spin_lock(&inode->i_lock);
|
spin_lock(&inode->i_lock);
|
||||||
|
@ -402,22 +396,18 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
|
||||||
LASSERT(alias != dentry);
|
LASSERT(alias != dentry);
|
||||||
|
|
||||||
spin_lock(&alias->d_lock);
|
spin_lock(&alias->d_lock);
|
||||||
if ((alias->d_flags & DCACHE_DISCONNECTED) &&
|
if (alias->d_parent == dentry->d_parent &&
|
||||||
S_ISDIR(inode->i_mode))
|
alias->d_name.hash == dentry->d_name.hash &&
|
||||||
/* LASSERT(last_discon == NULL); LU-405, bz 20055 */
|
alias->d_name.len == dentry->d_name.len &&
|
||||||
discon_alias = alias;
|
memcmp(alias->d_name.name, dentry->d_name.name,
|
||||||
else if (alias->d_parent == dentry->d_parent &&
|
dentry->d_name.len) == 0)
|
||||||
alias->d_name.hash == dentry->d_name.hash &&
|
|
||||||
alias->d_name.len == dentry->d_name.len &&
|
|
||||||
memcmp(alias->d_name.name, dentry->d_name.name,
|
|
||||||
dentry->d_name.len) == 0)
|
|
||||||
invalid_alias = alias;
|
invalid_alias = alias;
|
||||||
spin_unlock(&alias->d_lock);
|
spin_unlock(&alias->d_lock);
|
||||||
|
|
||||||
if (invalid_alias)
|
if (invalid_alias)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
alias = invalid_alias ?: discon_alias ?: NULL;
|
alias = invalid_alias ?: NULL;
|
||||||
if (alias) {
|
if (alias) {
|
||||||
spin_lock(&alias->d_lock);
|
spin_lock(&alias->d_lock);
|
||||||
dget_dlock(alias);
|
dget_dlock(alias);
|
||||||
|
|
Loading…
Reference in New Issue