Lines Matching refs:sbi
15 void autofs_catatonic_mode(struct autofs_sb_info *sbi) in autofs_catatonic_mode() argument
19 mutex_lock(&sbi->wq_mutex); in autofs_catatonic_mode()
20 if (sbi->flags & AUTOFS_SBI_CATATONIC) { in autofs_catatonic_mode()
21 mutex_unlock(&sbi->wq_mutex); in autofs_catatonic_mode()
27 sbi->flags |= AUTOFS_SBI_CATATONIC; in autofs_catatonic_mode()
28 wq = sbi->queues; in autofs_catatonic_mode()
29 sbi->queues = NULL; /* Erase all wait queues */ in autofs_catatonic_mode()
40 fput(sbi->pipe); /* Close the pipe */ in autofs_catatonic_mode()
41 sbi->pipe = NULL; in autofs_catatonic_mode()
42 sbi->pipefd = -1; in autofs_catatonic_mode()
43 mutex_unlock(&sbi->wq_mutex); in autofs_catatonic_mode()
46 static int autofs_write(struct autofs_sb_info *sbi, in autofs_write() argument
55 mutex_lock(&sbi->pipe_mutex); in autofs_write()
63 mutex_unlock(&sbi->pipe_mutex); in autofs_write()
79 static void autofs_notify_daemon(struct autofs_sb_info *sbi, in autofs_notify_daemon() argument
98 pkt.hdr.proto_version = sbi->version; in autofs_notify_daemon()
138 struct user_namespace *user_ns = sbi->pipe->f_cred->user_ns; in autofs_notify_daemon()
156 mutex_unlock(&sbi->wq_mutex); in autofs_notify_daemon()
160 pipe = get_file(sbi->pipe); in autofs_notify_daemon()
162 mutex_unlock(&sbi->wq_mutex); in autofs_notify_daemon()
164 switch (ret = autofs_write(sbi, pipe, &pkt, pktsz)) { in autofs_notify_daemon()
170 autofs_wait_release(sbi, wq->wait_queue_token, ret); in autofs_notify_daemon()
173 autofs_catatonic_mode(sbi); in autofs_notify_daemon()
180 autofs_find_wait(struct autofs_sb_info *sbi, const struct qstr *qstr) in autofs_find_wait() argument
184 for (wq = sbi->queues; wq; wq = wq->next) { in autofs_find_wait()
203 struct autofs_sb_info *sbi, in validate_request() argument
211 if (sbi->flags & AUTOFS_SBI_CATATONIC) in validate_request()
215 wq = autofs_find_wait(sbi, qstr); in validate_request()
241 mutex_unlock(&sbi->wq_mutex); in validate_request()
243 if (mutex_lock_interruptible(&sbi->wq_mutex)) in validate_request()
246 if (sbi->flags & AUTOFS_SBI_CATATONIC) in validate_request()
249 wq = autofs_find_wait(sbi, qstr); in validate_request()
303 int autofs_wait(struct autofs_sb_info *sbi, in autofs_wait() argument
316 if (sbi->flags & AUTOFS_SBI_CATATONIC) in autofs_wait()
324 pid = task_pid_nr_ns(current, ns_of_pid(sbi->oz_pgrp)); in autofs_wait()
325 tgid = task_tgid_nr_ns(current, ns_of_pid(sbi->oz_pgrp)); in autofs_wait()
338 if (autofs_type_trigger(sbi->type)) in autofs_wait()
349 if (IS_ROOT(dentry) && autofs_type_trigger(sbi->type)) { in autofs_wait()
364 if (mutex_lock_interruptible(&sbi->wq_mutex)) { in autofs_wait()
369 ret = validate_request(&wq, sbi, &qstr, path, notify); in autofs_wait()
372 mutex_unlock(&sbi->wq_mutex); in autofs_wait()
382 mutex_unlock(&sbi->wq_mutex); in autofs_wait()
389 wq->next = sbi->queues; in autofs_wait()
390 sbi->queues = wq; in autofs_wait()
394 wq->dev = autofs_get_dev(sbi); in autofs_wait()
395 wq->ino = autofs_get_ino(sbi); in autofs_wait()
403 if (sbi->version < 5) { in autofs_wait()
410 type = autofs_type_trigger(sbi->type) ? in autofs_wait()
414 type = autofs_type_trigger(sbi->type) ? in autofs_wait()
426 autofs_notify_daemon(sbi, wq, type); in autofs_wait()
432 mutex_unlock(&sbi->wq_mutex); in autofs_wait()
467 spin_lock(&sbi->fs_lock); in autofs_wait()
470 spin_unlock(&sbi->fs_lock); in autofs_wait()
478 mutex_lock(&sbi->wq_mutex); in autofs_wait()
481 mutex_unlock(&sbi->wq_mutex); in autofs_wait()
487 int autofs_wait_release(struct autofs_sb_info *sbi, in autofs_wait_release() argument
492 mutex_lock(&sbi->wq_mutex); in autofs_wait_release()
493 for (wql = &sbi->queues; (wq = *wql) != NULL; wql = &wq->next) { in autofs_wait_release()
499 mutex_unlock(&sbi->wq_mutex); in autofs_wait_release()
510 mutex_unlock(&sbi->wq_mutex); in autofs_wait_release()