Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 753
b: refs/heads/master
c: 4dcd00b
h: refs/heads/master
i:
  751: 0262af0
v: v3
  • Loading branch information
Ian Kent authored and Linus Torvalds committed May 1, 2005
1 parent f489649 commit f009727
Show file tree
Hide file tree
Showing 3 changed files with 14 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: 945b092011c6af71a0107be96e119c8c08776f3f
refs/heads/master: 4dcd00b18118d174c4b8d838c11f437f0af3c20c
1 change: 1 addition & 0 deletions trunk/fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct autofs_wait_queue {
char *name;
/* This is for status reporting upon return */
int status;
atomic_t notified;
atomic_t wait_ctr;
};

Expand Down
22 changes: 12 additions & 10 deletions trunk/fs/autofs4/waitq.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,8 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
wq->len = len;
wq->status = -EINTR; /* Status return if interrupted */
atomic_set(&wq->wait_ctr, 2);
atomic_set(&wq->notified, 1);
up(&sbi->wq_sem);

DPRINTK("new wait id = 0x%08lx, name = %.*s, nfy=%d",
(unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
/* autofs4_notify_daemon() may block */
if (notify != NFY_NONE) {
autofs4_notify_daemon(sbi,wq,
notify == NFY_MOUNT ?
autofs_ptype_missing :
autofs_ptype_expire_multi);
}
} else {
atomic_inc(&wq->wait_ctr);
up(&sbi->wq_sem);
Expand All @@ -229,6 +220,17 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
(unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
}

if (notify != NFY_NONE && atomic_dec_and_test(&wq->notified)) {
int type = (notify == NFY_MOUNT ?
autofs_ptype_missing : autofs_ptype_expire_multi);

DPRINTK(("new wait id = 0x%08lx, name = %.*s, nfy=%d\n",
(unsigned long) wq->wait_queue_token, wq->len, wq->name, notify));

/* autofs4_notify_daemon() may block */
autofs4_notify_daemon(sbi, wq, type);
}

/* wq->name is NULL if and only if the lock is already released */

if ( sbi->catatonic ) {
Expand Down

0 comments on commit f009727

Please sign in to comment.