Lines Matching refs:wq

28 	struct autofs_wait_queue *wq, *nwq;  in autofs_catatonic_mode()  local
33 wq = sbi->queues; in autofs_catatonic_mode()
35 while ( wq ) { in autofs_catatonic_mode()
36 nwq = wq->next; in autofs_catatonic_mode()
37 wq->status = -ENOENT; /* Magic is gone - report failure */ in autofs_catatonic_mode()
38 kfree(wq->name); in autofs_catatonic_mode()
39 wq->name = NULL; in autofs_catatonic_mode()
40 wake_up(&wq->queue); in autofs_catatonic_mode()
41 wq = nwq; in autofs_catatonic_mode()
82 static void autofs_notify_daemon(struct autofs_sb_info *sbi, struct autofs_wait_queue *wq) in autofs_notify_daemon() argument
86 DPRINTK(("autofs_wait: wait id = 0x%08lx, name = ", wq->wait_queue_token)); in autofs_notify_daemon()
87 autofs_say(wq->name,wq->len); in autofs_notify_daemon()
93 pkt.wait_queue_token = wq->wait_queue_token; in autofs_notify_daemon()
94 pkt.len = wq->len; in autofs_notify_daemon()
95 memcpy(pkt.name, wq->name, pkt.len); in autofs_notify_daemon()
104 struct autofs_wait_queue *wq; in autofs_wait() local
115 for ( wq = sbi->queues ; wq ; wq = wq->next ) { in autofs_wait()
116 if ( wq->hash == name->hash && in autofs_wait()
117 wq->len == name->len && in autofs_wait()
118 wq->name && !memcmp(wq->name,name->name,name->len) ) in autofs_wait()
122 if ( !wq ) { in autofs_wait()
124 wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL); in autofs_wait()
125 if ( !wq ) in autofs_wait()
128 wq->name = kmalloc(name->len,GFP_KERNEL); in autofs_wait()
129 if ( !wq->name ) { in autofs_wait()
130 kfree(wq); in autofs_wait()
133 wq->wait_queue_token = autofs_next_wait_queue++; in autofs_wait()
134 init_waitqueue_head(&wq->queue); in autofs_wait()
135 wq->hash = name->hash; in autofs_wait()
136 wq->len = name->len; in autofs_wait()
137 wq->status = -EINTR; /* Status return if interrupted */ in autofs_wait()
138 memcpy(wq->name, name->name, name->len); in autofs_wait()
139 wq->next = sbi->queues; in autofs_wait()
140 sbi->queues = wq; in autofs_wait()
143 wq->wait_ctr = 2; in autofs_wait()
144 autofs_notify_daemon(sbi,wq); in autofs_wait()
146 wq->wait_ctr++; in autofs_wait()
152 wq->status = -ENOENT; in autofs_wait()
153 if ( wq->name ) { in autofs_wait()
154 kfree(wq->name); in autofs_wait()
155 wq->name = NULL; in autofs_wait()
159 if ( wq->name ) { in autofs_wait()
170 interruptible_sleep_on(&wq->queue); in autofs_wait()
180 status = wq->status; in autofs_wait()
182 if ( ! --wq->wait_ctr ) /* Are we the last process to need status? */ in autofs_wait()
183 kfree(wq); in autofs_wait()
191 struct autofs_wait_queue *wq, **wql; in autofs_wait_release() local
193 for ( wql = &sbi->queues ; (wq = *wql) ; wql = &wq->next ) { in autofs_wait_release()
194 if ( wq->wait_queue_token == wait_queue_token ) in autofs_wait_release()
197 if ( !wq ) in autofs_wait_release()
200 *wql = wq->next; /* Unlink from chain */ in autofs_wait_release()
201 kfree(wq->name); in autofs_wait_release()
202 wq->name = NULL; /* Do not wait on this queue */ in autofs_wait_release()
204 wq->status = status; in autofs_wait_release()
206 if ( ! --wq->wait_ctr ) /* Is anyone still waiting for this guy? */ in autofs_wait_release()
207 kfree(wq); in autofs_wait_release()
209 wake_up(&wq->queue); in autofs_wait_release()