From owner-p4-projects@FreeBSD.ORG Wed Jul 4 13:42:49 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0823416A46D; Wed, 4 Jul 2007 13:42:49 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A4AA816A41F for ; Wed, 4 Jul 2007 13:42:48 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 954C513C4D3 for ; Wed, 4 Jul 2007 13:42:48 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l64Dgm0j071644 for ; Wed, 4 Jul 2007 13:42:48 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l64Dgm6H071641 for perforce@freebsd.org; Wed, 4 Jul 2007 13:42:48 GMT (envelope-from rdivacky@FreeBSD.org) Date: Wed, 4 Jul 2007 13:42:48 GMT Message-Id: <200707041342.l64Dgm6H071641@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 122854 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2007 13:42:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=122854 Change 122854 by rdivacky@rdivacky_witten on 2007/07/04 13:42:23 vrele() before Giant unlock. Use VFS_UNLOCK_GIANT macro. Reuse "vfslocked" variable where possible, elsewhere introduce "vfslocked1" varibale. Suggested by: jhb Affected files ... .. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#43 edit Differences ... ==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#43 (text+ko) ==== @@ -1164,9 +1164,9 @@ fdclose(fdp, fp, indx, td); fdrop(fp, td); if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -1272,9 +1272,9 @@ return (error); restart: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } error = kern_get_at(td, fd, &dvp); if (error && !kern_absolute_path(path, pathseg)) @@ -1354,9 +1354,9 @@ } } if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + int vfslocked1 = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked1); } NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); @@ -1419,9 +1419,9 @@ AUDIT_ARG(mode, mode); restart: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } error = kern_get_at(td, fd, &dvp); if (error && !kern_absolute_path(path, pathseg)) @@ -1477,9 +1477,9 @@ out: #endif if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + int vfslocked1 = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked1); } vput(nd.ni_dvp); vn_finished_write(mp); @@ -1602,9 +1602,9 @@ error = kern_get_at(td, fd2, &ldvp); if (error && !kern_absolute_path(path2, segflg)) { if (pdvp) { - if (VFS_NEEDSGIANT(pdvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(pdvp->v_mount); vrele(pdvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -1662,14 +1662,14 @@ out: if (pdvp) { - if (VFS_NEEDSGIANT(pdvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(pdvp->v_mount); vrele(pdvp); + VFS_UNLOCK_GIANT(vfslocked); } if (ldvp) { - if (VFS_NEEDSGIANT(ldvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(ldvp->v_mount); vrele(ldvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -1737,9 +1737,9 @@ AUDIT_ARG(text, syspath); restart: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } error = kern_get_at(td, fd, &dvp); if (error && !kern_absolute_path(path2, segflg)) @@ -1793,9 +1793,9 @@ VFS_UNLOCK_GIANT(vfslocked); out: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } if (segflg != UIO_SYSSPACE) uma_zfree(namei_zone, syspath); @@ -1911,9 +1911,9 @@ restart: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } error = kern_get_at(td, fd, &dvp); if (error && !kern_absolute_path(path, pathseg)) @@ -1972,9 +1972,9 @@ NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + int vfslocked1 = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked1); } if (vp == nd.ni_dvp) vrele(vp); @@ -2228,9 +2228,9 @@ td->td_ucred = cred; crfree(tmpcred); if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -2447,9 +2447,9 @@ *sbp = sb; out: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -2514,9 +2514,9 @@ *sbp = sb; out: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -2743,9 +2743,9 @@ td->td_retval[0] = count - auio.uio_resid; out: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -2993,9 +2993,9 @@ VFS_UNLOCK_GIANT(vfslocked); out: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -3045,9 +3045,9 @@ vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); @@ -3192,9 +3192,9 @@ VFS_UNLOCK_GIANT(vfslocked); out: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -3253,9 +3253,9 @@ VFS_UNLOCK_GIANT(vfslocked); out: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -3443,9 +3443,9 @@ VFS_UNLOCK_GIANT(vfslocked); out: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -3835,9 +3835,9 @@ error = kern_get_at(td, newfd, &todvp); if (error && !kern_absolute_path(new, pathseg)) { if (frdvp) { - if (VFS_NEEDSGIANT(frdvp->v_mount)) - mtx_unlock(&Giant); + fvfslocked = VFS_NEEDSGIANT(frdvp->v_mount); vrele(frdvp); + VFS_UNLOCK_GIANT(fvfslocked); } return (error); } @@ -3947,14 +3947,14 @@ return (0); out2: if (frdvp) { - if (VFS_NEEDSGIANT(frdvp->v_mount)) - mtx_unlock(&Giant); + fvfslocked = VFS_NEEDSGIANT(frdvp->v_mount); vrele(frdvp); + VFS_UNLOCK_GIANT(fvfslocked); } if (todvp) { - if (VFS_NEEDSGIANT(todvp->v_mount)) - mtx_unlock(&Giant); + tvfslocked = VFS_NEEDSGIANT(todvp->v_mount); vrele(todvp); + VFS_UNLOCK_GIANT(tvfslocked); } return (error); } @@ -4013,9 +4013,9 @@ AUDIT_ARG(mode, mode); restart: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } error = kern_get_at(td, fd, &dvp); if (error && !kern_absolute_path(path, segflg)) @@ -4076,9 +4076,9 @@ out: #endif if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + int vfslocked1 = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked1); } NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); @@ -4125,9 +4125,9 @@ restart: if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + vfslocked = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); } error = kern_get_at(td, fd, &dvp); if (error && !kern_absolute_path(path, pathseg)) @@ -4183,9 +4183,9 @@ NDFREE(&nd, NDF_ONLY_PNBUF); vput(vp); if (dvp) { - if (VFS_NEEDSGIANT(dvp->v_mount)) - mtx_unlock(&Giant); + int vfslocked1 = VFS_NEEDSGIANT(dvp->v_mount); vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked1); } if (nd.ni_dvp == vp) vrele(nd.ni_dvp);