Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23059
b: refs/heads/master
c: 1d5599e
h: refs/heads/master
i:
  23057: 001797a
  23055: bbe8387
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Mar 23, 2006
1 parent 25b951e commit 0ae5cc7
Show file tree
Hide file tree
Showing 4 changed files with 12 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: 1eb0d67007e75697a7b87e6b611be935a991395c
refs/heads/master: 1d5599e397dcc7c2300d200e66dad326d7dbac38
3 changes: 2 additions & 1 deletion trunk/fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/* Internal header file for autofs */

#include <linux/auto_fs4.h>
#include <linux/mutex.h>
#include <linux/list.h>

/* This is the range of ioctl() numbers we claim as ours */
Expand Down Expand Up @@ -102,7 +103,7 @@ struct autofs_sb_info {
int reghost_enabled;
int needs_reghost;
struct super_block *sb;
struct semaphore wq_sem;
struct mutex wq_mutex;
spinlock_t fs_lock;
struct autofs_wait_queue *queues; /* Wait queue pointer */
};
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/autofs4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
sbi->sb = s;
sbi->version = 0;
sbi->sub_version = 0;
init_MUTEX(&sbi->wq_sem);
mutex_init(&sbi->wq_mutex);
spin_lock_init(&sbi->fs_lock);
sbi->queues = NULL;
s->s_blocksize = 1024;
Expand Down
16 changes: 8 additions & 8 deletions trunk/fs/autofs4/waitq.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
return -ENOENT;
}

if (down_interruptible(&sbi->wq_sem)) {
if (mutex_lock_interruptible(&sbi->wq_mutex)) {
kfree(name);
return -EINTR;
}
Expand All @@ -194,15 +194,15 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
/* Can't wait for an expire if there's no mount */
if (notify == NFY_NONE && !d_mountpoint(dentry)) {
kfree(name);
up(&sbi->wq_sem);
mutex_unlock(&sbi->wq_mutex);
return -ENOENT;
}

/* Create a new wait queue */
wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL);
if ( !wq ) {
kfree(name);
up(&sbi->wq_sem);
mutex_unlock(&sbi->wq_mutex);
return -ENOMEM;
}

Expand All @@ -218,10 +218,10 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
wq->status = -EINTR; /* Status return if interrupted */
atomic_set(&wq->wait_ctr, 2);
atomic_set(&wq->notified, 1);
up(&sbi->wq_sem);
mutex_unlock(&sbi->wq_mutex);
} else {
atomic_inc(&wq->wait_ctr);
up(&sbi->wq_sem);
mutex_unlock(&sbi->wq_mutex);
kfree(name);
DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d",
(unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
Expand Down Expand Up @@ -282,19 +282,19 @@ int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_tok
{
struct autofs_wait_queue *wq, **wql;

down(&sbi->wq_sem);
mutex_lock(&sbi->wq_mutex);
for ( wql = &sbi->queues ; (wq = *wql) != 0 ; wql = &wq->next ) {
if ( wq->wait_queue_token == wait_queue_token )
break;
}

if ( !wq ) {
up(&sbi->wq_sem);
mutex_unlock(&sbi->wq_mutex);
return -EINVAL;
}

*wql = wq->next; /* Unlink from chain */
up(&sbi->wq_sem);
mutex_unlock(&sbi->wq_mutex);
kfree(wq->name);
wq->name = NULL; /* Do not wait on this queue */

Expand Down

0 comments on commit 0ae5cc7

Please sign in to comment.