From owner-svn-src-stable-7@FreeBSD.ORG Fri Aug 20 20:33:16 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15EE31065670; Fri, 20 Aug 2010 20:33:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F250D8FC13; Fri, 20 Aug 2010 20:33:13 +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 o7KKXDLp047336; Fri, 20 Aug 2010 20:33:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KKXDg2047330; Fri, 20 Aug 2010 20:33:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008202033.o7KKXDg2047330@svn.freebsd.org> From: John Baldwin Date: Fri, 20 Aug 2010 20:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211532 - in stable/7/sys: fs/nwfs fs/pseudofs fs/smbfs gnu/fs/xfs/FreeBSD kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2010 20:33:16 -0000 Author: jhb Date: Fri Aug 20 20:33:13 2010 New Revision: 211532 URL: http://svn.freebsd.org/changeset/base/211532 Log: MFC: Use VN_LOCK_AREC() and VN_LOCK_ASHARE() rather than manipulating lockmgr lock flags directly. Modified: stable/7/sys/fs/nwfs/nwfs_node.c stable/7/sys/fs/pseudofs/pseudofs_vncache.c stable/7/sys/fs/smbfs/smbfs_node.c stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c stable/7/sys/kern/vfs_lookup.c Modified: stable/7/sys/fs/nwfs/nwfs_node.c ============================================================================== --- stable/7/sys/fs/nwfs/nwfs_node.c Fri Aug 20 19:46:50 2010 (r211531) +++ stable/7/sys/fs/nwfs/nwfs_node.c Fri Aug 20 20:33:13 2010 (r211532) @@ -192,7 +192,7 @@ rescan: if (dvp) { np->n_parent = VTONW(dvp)->n_fid; } - vp->v_vnlock->lk_flags |= LK_CANRECURSE; + VN_LOCK_AREC(vp); sx_xlock(&nwhashlock); /* * Another process can create vnode while we blocked in malloc() or Modified: stable/7/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- stable/7/sys/fs/pseudofs/pseudofs_vncache.c Fri Aug 20 19:46:50 2010 (r211531) +++ stable/7/sys/fs/pseudofs/pseudofs_vncache.c Fri Aug 20 20:33:13 2010 (r211532) @@ -189,7 +189,7 @@ retry: if ((pn->pn_flags & PFS_PROCDEP) != 0) (*vpp)->v_vflag |= VV_PROCDEP; pvd->pvd_vnode = *vpp; - (*vpp)->v_vnlock->lk_flags |= LK_CANRECURSE; + VN_LOCK_AREC(*vpp); vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread); error = insmntque(*vpp, mp); if (error != 0) { Modified: stable/7/sys/fs/smbfs/smbfs_node.c ============================================================================== --- stable/7/sys/fs/smbfs/smbfs_node.c Fri Aug 20 19:46:50 2010 (r211531) +++ stable/7/sys/fs/smbfs/smbfs_node.c Fri Aug 20 20:33:13 2010 (r211532) @@ -259,7 +259,7 @@ loop: } else if (vp->v_type == VREG) SMBERROR("new vnode '%s' born without parent ?\n", np->n_name); - vp->v_vnlock->lk_flags |= LK_CANRECURSE; + VN_LOCK_AREC(vp); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); smbfs_hash_lock(smp); Modified: stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c ============================================================================== --- stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c Fri Aug 20 19:46:50 2010 (r211531) +++ stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c Fri Aug 20 20:33:13 2010 (r211532) @@ -29,6 +29,8 @@ * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ + * + * $FreeBSD$ */ #include "xfs.h" @@ -389,7 +391,7 @@ xfs_vn_allocate(xfs_mount_t *mp, xfs_ino return (error); } - vp->v_vnlock->lk_flags |= LK_CANRECURSE; + VN_LOCK_AREC(vp); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); error = insmntque(vp, XVFSTOMNT(XFS_MTOVFS(mp))); if (error != 0) { Modified: stable/7/sys/kern/vfs_lookup.c ============================================================================== --- stable/7/sys/kern/vfs_lookup.c Fri Aug 20 19:46:50 2010 (r211531) +++ stable/7/sys/kern/vfs_lookup.c Fri Aug 20 20:33:13 2010 (r211532) @@ -83,7 +83,7 @@ nameiinit(void *dummy __unused) error = getnewvnode("crossmp", NULL, &dead_vnodeops, &vp_crossmp); if (error != 0) panic("nameiinit: getnewvnode"); - vp_crossmp->v_vnlock->lk_flags &= ~LK_NOSHARE; + VN_LOCK_ASHARE(vp_crossmp); } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL);