diff options
author | kib <kib@FreeBSD.org> | 2010-08-06 09:42:15 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-08-06 09:42:15 +0000 |
commit | ba7ee96f4acc27c8c70a4af6c81be42c4856619f (patch) | |
tree | 7da521a717547b550e58c94609d3078b5dd9e826 /sys/kern/tty.c | |
parent | c3d4f0835cad384499298be886c0a8afc90d5822 (diff) | |
download | FreeBSD-src-ba7ee96f4acc27c8c70a4af6c81be42c4856619f.zip FreeBSD-src-ba7ee96f4acc27c8c70a4af6c81be42c4856619f.tar.gz |
Add new make_dev_p(9) flag MAKEDEV_ETERNAL to inform devfs that created
cdev will never be destroyed. Propagate the flag to devfs vnodes as
VV_ETERNVALDEV. Use the flags to avoid acquiring devmtx and taking a
thread reference on such nodes.
In collaboration with: pho
MFC after: 1 month
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 917fb7b..9021849 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1797,7 +1797,7 @@ ttyhook_register(struct tty **rtp, struct proc *p, int fd, struct cdev *dev; struct cdevsw *cdp; struct filedesc *fdp; - int error; + int error, ref; /* Validate the file descriptor. */ if ((fdp = p->p_fd) == NULL) @@ -1823,7 +1823,7 @@ ttyhook_register(struct tty **rtp, struct proc *p, int fd, } /* Make sure it is a TTY. */ - cdp = devvn_refthread(fp->f_vnode, &dev); + cdp = devvn_refthread(fp->f_vnode, &dev, &ref); if (cdp == NULL) { error = ENXIO; goto done1; @@ -1859,7 +1859,7 @@ ttyhook_register(struct tty **rtp, struct proc *p, int fd, th->th_rint = ttyhook_defrint; done3: tty_unlock(tp); -done2: dev_relthread(dev); +done2: dev_relthread(dev, ref); done1: fdrop(fp, curthread); return (error); } |