fs: scale inode alias list
Add a new lock, dcache_inode_lock, to protect the inode's i_dentry list from concurrent modification. d_alias is also protected by d_lock. Signed-off-by: Nick Piggin <npiggin@kernel.dk>
This commit is contained in:
@@ -48,8 +48,10 @@ find_acceptable_alias(struct dentry *result,
|
||||
return result;
|
||||
|
||||
spin_lock(&dcache_lock);
|
||||
spin_lock(&dcache_inode_lock);
|
||||
list_for_each_entry(dentry, &result->d_inode->i_dentry, d_alias) {
|
||||
dget_locked(dentry);
|
||||
spin_unlock(&dcache_inode_lock);
|
||||
spin_unlock(&dcache_lock);
|
||||
if (toput)
|
||||
dput(toput);
|
||||
@@ -58,8 +60,10 @@ find_acceptable_alias(struct dentry *result,
|
||||
return dentry;
|
||||
}
|
||||
spin_lock(&dcache_lock);
|
||||
spin_lock(&dcache_inode_lock);
|
||||
toput = dentry;
|
||||
}
|
||||
spin_unlock(&dcache_inode_lock);
|
||||
spin_unlock(&dcache_lock);
|
||||
|
||||
if (toput)
|
||||
|
Reference in New Issue
Block a user