14 #include <linux/slab.h>
15 #include <linux/time.h>
16 #include <linux/signal.h>
25 #define SHUTDOWN_SIGS (sigmask(SIGKILL) | sigmask(SIGINT) | sigmask(SIGQUIT))
37 DPRINTK(
"entering catatonic mode");
62 unsigned long sigpipe,
flags;
64 const char *
data = (
const char *)addr;
75 (wr = file->
f_op->write(file,data,bytes,&file->
f_pos)) > 0) {
85 if (wr == -
EPIPE && !sigpipe) {
89 spin_unlock_irqrestore(&
current->sighand->siglock, flags);
107 DPRINTK(
"wait id = 0x%08lx, name = %.*s, type=%d",
110 memset(&pkt,0,
sizeof pkt);
112 pkt.hdr.proto_version = sbi->
version;
158 pktsz =
sizeof(*packet);
173 printk(
"autofs4_notify_daemon: bad type %d!\n", type);
178 pipe = get_file(sbi->
pipe);
182 if (autofs4_write(sbi, pipe, &pkt, pktsz))
190 struct dentry *
root = sbi->
sb->s_root;
201 seq = read_seqbegin(&rename_lock);
204 for (tmp = dentry ; tmp != root ; tmp = tmp->
d_parent)
205 len += tmp->
d_name.len + 1;
210 if (read_seqretry(&rename_lock, seq))
216 p = buf + len - dentry->
d_name.len;
226 if (read_seqretry(&rename_lock, seq))
238 if (wq->
name.hash == qstr->hash &&
239 wq->
name.len == qstr->len &&
267 wq = autofs4_find_wait(sbi, qstr);
276 ino = autofs4_dentry_ino(dentry);
301 wq = autofs4_find_wait(sbi, qstr);
321 struct dentry *
new =
NULL;
332 if (dentry->
d_inode && d_unhashed(dentry)) {
371 if (autofs_type_trigger(sbi->
type))
382 if (
IS_ROOT(dentry) && autofs_type_trigger(sbi->
type))
383 qstr.len =
sprintf(name,
"%p", dentry);
385 qstr.len = autofs4_getpath(sbi, dentry, &name);
399 ret = validate_request(&wq, sbi, &qstr, dentry, notify);
417 if (++autofs4_next_wait_queue == 0)
418 autofs4_next_wait_queue = 1;
422 memcpy(&wq->
name, &qstr,
sizeof(
struct qstr));
423 wq->
dev = autofs4_get_dev(sbi);
424 wq->
ino = autofs4_get_ino(sbi);
440 type = autofs_type_trigger(sbi->
type) ?
444 type = autofs_type_trigger(sbi->
type) ?
449 DPRINTK(
"new wait id = 0x%08lx, name = %.*s, nfy=%d\n",
451 wq->
name.name, notify);
454 autofs4_notify_daemon(sbi, wq, type);
459 DPRINTK(
"existing wait id = 0x%08lx, name = %.*s, nfy=%d",
461 wq->
name.name, notify);
471 unsigned long irqflags;
477 spin_unlock_irqrestore(&
current->sighand->siglock, irqflags);
484 spin_unlock_irqrestore(&
current->sighand->siglock, irqflags);
502 struct dentry *de =
NULL;
505 ino = autofs4_dentry_ino(dentry);
510 ino = autofs4_dentry_ino(de);