Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Aug 2010 20:33:13 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r211532 - in stable/7/sys: fs/nwfs fs/pseudofs fs/smbfs gnu/fs/xfs/FreeBSD kern
Message-ID:  <201008202033.o7KKXDg2047330@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008202033.o7KKXDg2047330>