Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321687
b: refs/heads/master
c: a45440f
h: refs/heads/master
i:
  321685: 9378f9c
  321683: 7b13878
  321679: d797f11
v: v3
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Aug 16, 2012
1 parent b200672 commit f082aec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 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: 63ca5f1d17a4eecaec3149982223fe89e55a568f
refs/heads/master: a45440f05e9ebc26f2a375df911823fdef5b5281
31 changes: 13 additions & 18 deletions trunk/fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,21 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,
{
struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb);
struct list_head *next;
struct dentry *p, *q;
struct dentry *q;

spin_lock(&sbi->lookup_lock);
spin_lock(&root->d_lock);

if (prev == NULL) {
spin_lock(&root->d_lock);
if (prev)
next = prev->d_u.d_child.next;
else {
prev = dget_dlock(root);
next = prev->d_subdirs.next;
p = prev;
goto start;
}

p = prev;
spin_lock(&p->d_lock);
again:
next = p->d_u.d_child.next;
start:
cont:
if (next == &root->d_subdirs) {
spin_unlock(&p->d_lock);
spin_unlock(&root->d_lock);
spin_unlock(&sbi->lookup_lock);
dput(prev);
return NULL;
Expand All @@ -121,16 +117,15 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,
q = list_entry(next, struct dentry, d_u.d_child);

spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED);
/* Negative dentry - try next */
if (!simple_positive(q)) {
spin_unlock(&p->d_lock);
lock_set_subclass(&q->d_lock.dep_map, 0, _RET_IP_);
p = q;
goto again;
/* Already gone or negative dentry (under construction) - try next */
if (q->d_count == 0 || !simple_positive(q)) {
spin_unlock(&q->d_lock);
next = q->d_u.d_child.next;
goto cont;
}
dget_dlock(q);
spin_unlock(&q->d_lock);
spin_unlock(&p->d_lock);
spin_unlock(&root->d_lock);
spin_unlock(&sbi->lookup_lock);

dput(prev);
Expand Down

0 comments on commit f082aec

Please sign in to comment.