Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Feb 2010 09:29:32 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r203333 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201002010929.o119TXB8002814@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Feb  1 09:29:32 2010
New Revision: 203333
URL: http://svn.freebsd.org/changeset/base/203333

Log:
  Reduce diff against OpenSolaris - move Giant acquire/release to
  zfs_znode.c.  As a side effect this also eliminates two potential
  Giant leaks.
  
  Approved by:  pjd

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.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/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Mon Feb  1 01:06:36 2010	(r203332)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Mon Feb  1 09:29:32 2010	(r203333)
@@ -557,9 +557,6 @@ zfs_rmnode(znode_t *zp)
 	dmu_tx_t	*tx;
 	uint64_t	acl_obj;
 	int		error;
-	int		vfslocked;
-
-	vfslocked = VFS_LOCK_GIANT(zfsvfs->z_vfs);
 
 	ASSERT(zp->z_phys->zp_links == 0);
 
@@ -593,7 +590,6 @@ zfs_rmnode(znode_t *zp)
 			 */
 			zfs_znode_dmu_fini(zp);
 			zfs_znode_free(zp);
-			VFS_UNLOCK_GIANT(vfslocked);
 			return;
 		}
 	}
@@ -666,7 +662,6 @@ zfs_rmnode(znode_t *zp)
 out:
 	if (xzp)
 		VN_RELE(ZTOV(xzp));
-	VFS_UNLOCK_GIANT(vfslocked);
 }
 
 static uint64_t

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Mon Feb  1 01:06:36 2010	(r203332)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Mon Feb  1 09:29:32 2010	(r203333)
@@ -1017,6 +1017,7 @@ zfs_zinactive(znode_t *zp)
 	vnode_t	*vp = ZTOV(zp);
 	zfsvfs_t *zfsvfs = zp->z_zfsvfs;
 	uint64_t z_id = zp->z_id;
+	int vfslocked;
 
 	ASSERT(zp->z_dbuf && zp->z_phys);
 
@@ -1049,7 +1050,9 @@ zfs_zinactive(znode_t *zp)
 		ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id);
 		ASSERT(vp->v_count == 0);
 		vrecycle(vp, curthread);
+		vfslocked = VFS_LOCK_GIANT(zfsvfs->z_vfs);
 		zfs_rmnode(zp);
+		VFS_UNLOCK_GIANT(vfslocked);
 		return;
 	}
 	mutex_exit(&zp->z_lock);



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