Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Sep 2013 18:07:14 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255942 - head/sys/kern
Message-ID:  <201309291807.r8TI7E3o055959@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Sep 29 18:07:14 2013
New Revision: 255942
URL: http://svnweb.freebsd.org/changeset/base/255942

Log:
  For vunref(), try to upgrade the vnode lock if the function was called
  with the vnode shared-locked.  If upgrade succeeded, the inactivation
  can be done immediately, instead of being postponed.
  
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Approved by:	re (glebius)

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Sun Sep 29 18:04:57 2013	(r255941)
+++ head/sys/kern/vfs_subr.c	Sun Sep 29 18:07:14 2013	(r255942)
@@ -2218,8 +2218,10 @@ vputx(struct vnode *vp, int func)
 		}
 		break;
 	case VPUTX_VUNREF:
-		if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE)
-			error = EBUSY;
+		if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) {
+			error = VOP_LOCK(vp, LK_TRYUPGRADE | LK_INTERLOCK);
+			VI_LOCK(vp);
+		}
 		break;
 	}
 	if (vp->v_usecount > 0)



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