From owner-svn-src-all@FreeBSD.ORG Mon Feb 1 11:05:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C828A106566B; Mon, 1 Feb 2010 11:05:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C2138FC12; Mon, 1 Feb 2010 11:05:19 +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 o11B5JVO026385; Mon, 1 Feb 2010 11:05:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o11B5JoE026382; Mon, 1 Feb 2010 11:05:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002011105.o11B5JoE026382@svn.freebsd.org> From: Xin LI Date: Mon, 1 Feb 2010 11:05:19 +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: r203338 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 11:05:20 -0000 Author: delphij Date: Mon Feb 1 11:05:19 2010 New Revision: 203338 URL: http://svn.freebsd.org/changeset/base/203338 Log: MFC r201406: 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: re (kib) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 1 10:56:12 2010 (r203337) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 1 11:05:19 2010 (r203338) @@ -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/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 1 10:56:12 2010 (r203337) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 1 11:05:19 2010 (r203338) @@ -1023,6 +1023,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); @@ -1055,7 +1056,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);