svn commit: r255942 - head/sys/kern

Konstantin Belousov kib at FreeBSD.org
Sun Sep 29 18:07:15 UTC 2013


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)


More information about the svn-src-all mailing list