From owner-svn-src-stable-8@FreeBSD.ORG Sun Sep 5 14:16:35 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ACB310656A6; Sun, 5 Sep 2010 14:16:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69FBA8FC0C; Sun, 5 Sep 2010 14:16:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o85EGZWt082963; Sun, 5 Sep 2010 14:16:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o85EGZin082961; Sun, 5 Sep 2010 14:16:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201009051416.o85EGZin082961@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 5 Sep 2010 14:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212227 - stable/8/sys/fs/devfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 14:16:35 -0000 Author: kib Date: Sun Sep 5 14:16:35 2010 New Revision: 212227 URL: http://svn.freebsd.org/changeset/base/212227 Log: MFC r210918: Initialize VV_ISTTY vnode flag on the devfs vnode creation instead of doing it on each open. Modified: stable/8/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_vnops.c Sun Sep 5 14:02:34 2010 (r212226) +++ stable/8/sys/fs/devfs/devfs_vnops.c Sun Sep 5 14:16:35 2010 (r212227) @@ -337,6 +337,7 @@ devfs_allocv(struct devfs_dirent *de, st 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, st 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; @@ -964,10 +969,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;