Lines Matching refs:wq
17 struct autofs_wait_queue *wq, *nwq; in autofs_catatonic_mode() local
28 wq = sbi->queues; in autofs_catatonic_mode()
30 while (wq) { in autofs_catatonic_mode()
31 nwq = wq->next; in autofs_catatonic_mode()
32 wq->status = -ENOENT; /* Magic is gone - report failure */ in autofs_catatonic_mode()
33 kfree(wq->name.name - wq->offset); in autofs_catatonic_mode()
34 wq->name.name = NULL; in autofs_catatonic_mode()
35 wake_up_interruptible(&wq->queue); in autofs_catatonic_mode()
36 if (!--wq->wait_ctr) in autofs_catatonic_mode()
37 kfree(wq); in autofs_catatonic_mode()
38 wq = nwq; in autofs_catatonic_mode()
80 struct autofs_wait_queue *wq, in autofs_notify_daemon() argument
93 (unsigned long) wq->wait_queue_token, in autofs_notify_daemon()
94 wq->name.len, wq->name.name, type); in autofs_notify_daemon()
109 mp->wait_queue_token = wq->wait_queue_token; in autofs_notify_daemon()
110 mp->len = wq->name.len; in autofs_notify_daemon()
111 memcpy(mp->name, wq->name.name, wq->name.len); in autofs_notify_daemon()
112 mp->name[wq->name.len] = '\0'; in autofs_notify_daemon()
122 ep->wait_queue_token = wq->wait_queue_token; in autofs_notify_daemon()
123 ep->len = wq->name.len; in autofs_notify_daemon()
124 memcpy(ep->name, wq->name.name, wq->name.len); in autofs_notify_daemon()
125 ep->name[wq->name.len] = '\0'; in autofs_notify_daemon()
142 packet->wait_queue_token = wq->wait_queue_token; in autofs_notify_daemon()
143 packet->len = wq->name.len; in autofs_notify_daemon()
144 memcpy(packet->name, wq->name.name, wq->name.len); in autofs_notify_daemon()
145 packet->name[wq->name.len] = '\0'; in autofs_notify_daemon()
146 packet->dev = wq->dev; in autofs_notify_daemon()
147 packet->ino = wq->ino; in autofs_notify_daemon()
148 packet->uid = from_kuid_munged(user_ns, wq->uid); in autofs_notify_daemon()
149 packet->gid = from_kgid_munged(user_ns, wq->gid); in autofs_notify_daemon()
150 packet->pid = wq->pid; in autofs_notify_daemon()
151 packet->tgid = wq->tgid; in autofs_notify_daemon()
170 autofs_wait_release(sbi, wq->wait_queue_token, ret); in autofs_notify_daemon()
182 struct autofs_wait_queue *wq; in autofs_find_wait() local
184 for (wq = sbi->queues; wq; wq = wq->next) { in autofs_find_wait()
185 if (wq->name.hash == qstr->hash && in autofs_find_wait()
186 wq->name.len == qstr->len && in autofs_find_wait()
187 wq->name.name && in autofs_find_wait()
188 !memcmp(wq->name.name, qstr->name, qstr->len)) in autofs_find_wait()
191 return wq; in autofs_find_wait()
208 struct autofs_wait_queue *wq; in validate_request() local
215 wq = autofs_find_wait(sbi, qstr); in validate_request()
216 if (wq) { in validate_request()
217 *wait = wq; in validate_request()
249 wq = autofs_find_wait(sbi, qstr); in validate_request()
250 if (wq) { in validate_request()
251 *wait = wq; in validate_request()
307 struct autofs_wait_queue *wq; in autofs_wait() local
369 ret = validate_request(&wq, sbi, &qstr, path, notify); in autofs_wait()
377 if (!wq) { in autofs_wait()
379 wq = kmalloc(sizeof(struct autofs_wait_queue), GFP_KERNEL); in autofs_wait()
380 if (!wq) { in autofs_wait()
386 wq->wait_queue_token = autofs_next_wait_queue; in autofs_wait()
389 wq->next = sbi->queues; in autofs_wait()
390 sbi->queues = wq; in autofs_wait()
391 init_waitqueue_head(&wq->queue); in autofs_wait()
392 memcpy(&wq->name, &qstr, sizeof(struct qstr)); in autofs_wait()
393 wq->offset = offset; in autofs_wait()
394 wq->dev = autofs_get_dev(sbi); in autofs_wait()
395 wq->ino = autofs_get_ino(sbi); in autofs_wait()
396 wq->uid = current_uid(); in autofs_wait()
397 wq->gid = current_gid(); in autofs_wait()
398 wq->pid = pid; in autofs_wait()
399 wq->tgid = tgid; in autofs_wait()
400 wq->status = -EINTR; /* Status return if interrupted */ in autofs_wait()
401 wq->wait_ctr = 2; in autofs_wait()
420 (unsigned long) wq->wait_queue_token, wq->name.len, in autofs_wait()
421 wq->name.name, notify); in autofs_wait()
426 autofs_notify_daemon(sbi, wq, type); in autofs_wait()
428 wq->wait_ctr++; in autofs_wait()
430 (unsigned long) wq->wait_queue_token, wq->name.len, in autofs_wait()
431 wq->name.name, notify); in autofs_wait()
440 wait_event_killable(wq->queue, wq->name.name == NULL); in autofs_wait()
441 status = wq->status; in autofs_wait()
468 ino->uid = wq->uid; in autofs_wait()
469 ino->gid = wq->gid; in autofs_wait()
479 if (!--wq->wait_ctr) in autofs_wait()
480 kfree(wq); in autofs_wait()
490 struct autofs_wait_queue *wq, **wql; in autofs_wait_release() local
493 for (wql = &sbi->queues; (wq = *wql) != NULL; wql = &wq->next) { in autofs_wait_release()
494 if (wq->wait_queue_token == wait_queue_token) in autofs_wait_release()
498 if (!wq) { in autofs_wait_release()
503 *wql = wq->next; /* Unlink from chain */ in autofs_wait_release()
504 kfree(wq->name.name - wq->offset); in autofs_wait_release()
505 wq->name.name = NULL; /* Do not wait on this queue */ in autofs_wait_release()
506 wq->status = status; in autofs_wait_release()
507 wake_up(&wq->queue); in autofs_wait_release()
508 if (!--wq->wait_ctr) in autofs_wait_release()
509 kfree(wq); in autofs_wait_release()