Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105466
b: refs/heads/master
c: 296f7bf
h: refs/heads/master
v: v3
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Jul 24, 2008
1 parent 0838891 commit ca77094
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 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: e64be33ccaceaca67c84237dff8805b861398eab
refs/heads/master: 296f7bf78bc5c7a4d772aea580ce800d14040d1a
2 changes: 1 addition & 1 deletion trunk/fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct autofs_wait_queue {
pid_t tgid;
/* This is for status reporting upon return */
int status;
atomic_t wait_ctr;
unsigned int wait_ctr;
};

#define AUTOFS_SBI_MAGIC 0x6d4a556d
Expand Down
18 changes: 9 additions & 9 deletions trunk/fs/autofs4/waitq.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void autofs4_catatonic_mode(struct autofs_sb_info *sbi)
kfree(wq->name.name);
wq->name.name = NULL;
}
wq->wait_ctr--;
wake_up_interruptible(&wq->queue);
wq = nwq;
}
Expand Down Expand Up @@ -380,7 +381,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
wq->pid = current->pid;
wq->tgid = current->tgid;
wq->status = -EINTR; /* Status return if interrupted */
atomic_set(&wq->wait_ctr, 2);
wq->wait_ctr = 2;
mutex_unlock(&sbi->wq_mutex);

if (sbi->version < 5) {
Expand All @@ -406,7 +407,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
/* autofs4_notify_daemon() may block */
autofs4_notify_daemon(sbi, wq, type);
} else {
atomic_inc(&wq->wait_ctr);
wq->wait_ctr++;
mutex_unlock(&sbi->wq_mutex);
kfree(qstr.name);
DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d",
Expand Down Expand Up @@ -442,8 +443,10 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
status = wq->status;

/* Are we the last process to need status? */
if (atomic_dec_and_test(&wq->wait_ctr))
mutex_lock(&sbi->wq_mutex);
if (!--wq->wait_ctr)
kfree(wq);
mutex_unlock(&sbi->wq_mutex);

return status;
}
Expand All @@ -467,14 +470,11 @@ int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_tok
*wql = wq->next; /* Unlink from chain */
kfree(wq->name.name);
wq->name.name = NULL; /* Do not wait on this queue */
mutex_unlock(&sbi->wq_mutex);

wq->status = status;

if (atomic_dec_and_test(&wq->wait_ctr)) /* Is anyone still waiting for this guy? */
wake_up_interruptible(&wq->queue);
if (!--wq->wait_ctr)
kfree(wq);
else
wake_up_interruptible(&wq->queue);
mutex_unlock(&sbi->wq_mutex);

return 0;
}
Expand Down

0 comments on commit ca77094

Please sign in to comment.