From owner-svn-src-all@FreeBSD.ORG Thu May 7 18:14:22 2009 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 248C6106566C; Thu, 7 May 2009 18:14:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12A338FC18; Thu, 7 May 2009 18:14:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n47IELT2063952; Thu, 7 May 2009 18:14:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n47IELHo063951; Thu, 7 May 2009 18:14:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200905071814.n47IELHo063951@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 May 2009 18:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191895 - head/sys/kern 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: Thu, 07 May 2009 18:14:23 -0000 Author: kib Date: Thu May 7 18:14:21 2009 New Revision: 191895 URL: http://svn.freebsd.org/changeset/base/191895 Log: Eliminate the loop and the call to pause(9) in vfs_vget_ino(). If vfs_busy(MBF_NOWAIT) failed, unlock the vnode and sleep in vfs_busy(). Suggested and reviewed by: jeff Tested by: pho MFC after: 3 weeks Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu May 7 18:03:47 2009 (r191894) +++ head/sys/kern/vfs_vnops.c Thu May 7 18:14:21 2009 (r191895) @@ -1292,15 +1292,17 @@ vn_vget_ino(struct vnode *vp, ino_t ino, ltype = VOP_ISLOCKED(vp); KASSERT(ltype == LK_EXCLUSIVE || ltype == LK_SHARED, ("vn_vget_ino: vp not locked")); - for (;;) { - error = vfs_busy(mp, MBF_NOWAIT); - if (error == 0) - break; + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) { VOP_UNLOCK(vp, 0); - pause("vn_vget", 1); + error = vfs_busy(mp, 0); vn_lock(vp, ltype | LK_RETRY); - if (vp->v_iflag & VI_DOOMED) + if (error != 0) + return (ENOENT); + if (vp->v_iflag & VI_DOOMED) { + vfs_unbusy(mp); return (ENOENT); + } } VOP_UNLOCK(vp, 0); error = VFS_VGET(mp, ino, lkflags, rvp);