]> err.no Git - linux-2.6/blobdiff - fs/autofs4/waitq.c
[PATCH] remove kernel/power/pm.c:pm_unregister()
[linux-2.6] / fs / autofs4 / waitq.c
index 12da2c977b0a55be8b75ad496137a58740e32970..142ab6aa2aa1516e6480d24c0ce3830b19852107 100644 (file)
@@ -207,7 +207,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
                return -ENOMEM;
 
        /* If this is a direct mount request create a dummy name */
-       if (IS_ROOT(dentry) && (sbi->type & AUTOFS_TYP_DIRECT))
+       if (IS_ROOT(dentry) && (sbi->type & AUTOFS_TYPE_DIRECT))
                len = sprintf(name, "%p", dentry);
        else {
                len = autofs4_getpath(sbi, dentry, &name);
@@ -263,7 +263,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
                wq->tgid = current->tgid;
                wq->status = -EINTR; /* Status return if interrupted */
                atomic_set(&wq->wait_ctr, 2);
-               atomic_set(&wq->notified, 1);
+               atomic_set(&wq->notify, 1);
                mutex_unlock(&sbi->wq_mutex);
        } else {
                atomic_inc(&wq->wait_ctr);
@@ -273,9 +273,11 @@ 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)) {
+       if (notify != NFY_NONE && atomic_read(&wq->notify)) {
                int type;
 
+               atomic_dec(&wq->notify);
+
                if (sbi->version < 5) {
                        if (notify == NFY_MOUNT)
                                type = autofs_ptype_missing;
@@ -283,11 +285,11 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
                                type = autofs_ptype_expire_multi;
                } else {
                        if (notify == NFY_MOUNT)
-                               type = (sbi->type & AUTOFS_TYP_DIRECT) ?
+                               type = (sbi->type & AUTOFS_TYPE_DIRECT) ?
                                        autofs_ptype_missing_direct :
                                         autofs_ptype_missing_indirect;
                        else
-                               type = (sbi->type & AUTOFS_TYP_DIRECT) ?
+                               type = (sbi->type & AUTOFS_TYPE_DIRECT) ?
                                        autofs_ptype_expire_direct :
                                        autofs_ptype_expire_indirect;
                }