Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226717
b: refs/heads/master
c: 89e6054
h: refs/heads/master
i:
  226715: f106927
v: v3
  • Loading branch information
Nick Piggin committed Jan 7, 2011
1 parent 0332d1b commit 2391618
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a734eb458ab2bd11479a27dd54f48e1b26a55845
refs/heads/master: 89e6054836a7b1e7500cd70a14b5579e752c9250
27 changes: 15 additions & 12 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,26 +582,29 @@ static void prune_one_dentry(struct dentry *dentry, struct dentry *parent)
* Prune ancestors.
*/
while (dentry) {
spin_lock(&dcache_inode_lock);
again:
relock:
spin_lock(&dentry->d_lock);
if (dentry->d_count > 1) {
dentry->d_count--;
spin_unlock(&dentry->d_lock);
return;
}
if (!spin_trylock(&dcache_inode_lock)) {
relock2:
spin_unlock(&dentry->d_lock);
cpu_relax();
goto relock;
}

if (IS_ROOT(dentry))
parent = NULL;
else
parent = dentry->d_parent;
if (parent && !spin_trylock(&parent->d_lock)) {
spin_unlock(&dentry->d_lock);
goto again;
}
dentry->d_count--;
if (dentry->d_count) {
if (parent)
spin_unlock(&parent->d_lock);
spin_unlock(&dentry->d_lock);
spin_unlock(&dcache_inode_lock);
return;
goto relock2;
}

dentry->d_count--;
dentry_lru_del(dentry);
__d_drop(dentry);
dentry = d_kill(dentry, parent);
Expand Down

0 comments on commit 2391618

Please sign in to comment.