summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-08-06 09:06:55 +0000
committerkib <kib@FreeBSD.org>2010-08-06 09:06:55 +0000
commit837d8df157cef778fb828ddd7776e24c8a537679 (patch)
treed36d664f629446427865dc5fd6071400d456befd
parentc17c1b915d3111d18a76bf56ac4f95d6a2cf5c17 (diff)
downloadFreeBSD-src-837d8df157cef778fb828ddd7776e24c8a537679.zip
FreeBSD-src-837d8df157cef778fb828ddd7776e24c8a537679.tar.gz
Initialize VV_ISTTY vnode flag on the devfs vnode creation instead of
doing it on each open. In collaboration with: pho MFC after: 1 month
-rw-r--r--sys/fs/devfs/devfs_vnops.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index c277355..6751d20 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -337,6 +337,7 @@ devfs_allocv(struct devfs_dirent *de, struct mount *mp, struct vnode **vpp)
struct vnode *vp;
struct cdev *dev;
struct devfs_mount *dmp;
+ struct cdevsw *dsw;
dmp = VFSTODEVFS(mp);
if (de->de_flags & DE_DOOMED) {
@@ -393,6 +394,10 @@ devfs_allocv(struct devfs_dirent *de, struct mount *mp, struct vnode **vpp)
KASSERT(vp->v_usecount == 1,
("%s %d (%d)\n", __func__, __LINE__, vp->v_usecount));
dev->si_usecount += vp->v_usecount;
+ /* Special casing of ttys for deadfs. Probably redundant. */
+ dsw = dev->si_devsw;
+ if (dsw != NULL && (dsw->d_flags & D_TTY) != 0)
+ vp->v_vflag |= VV_ISTTY;
dev_unlock();
VI_UNLOCK(vp);
vp->v_op = &devfs_specops;
@@ -972,10 +977,6 @@ devfs_open(struct vop_open_args *ap)
if (dsw == NULL)
return (ENXIO);
- /* XXX: Special casing of ttys for deadfs. Probably redundant. */
- if (dsw->d_flags & D_TTY)
- vp->v_vflag |= VV_ISTTY;
-
VOP_UNLOCK(vp, 0);
fpop = td->td_fpop;
OpenPOWER on IntegriCloud