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
This commit is contained in:
parent
a178ce03e1
commit
3a6fc63c9f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user