svn commit: r189148 - in stable/7/sys: . cam contrib/pf dev/cxgb

Edward Tomasz Napierala trasz at FreeBSD.org
Sat Feb 28 02:35:31 PST 2009


Author: trasz
Date: Sat Feb 28 10:35:30 2009
New Revision: 189148
URL: http://svn.freebsd.org/changeset/base/189148

Log:
  MFC r186320:
  
  Fix cam_sim_free() wakeup condition and add mtx_asserts.
  
  Submitted by:	Christoph Mallon
  Reviewed by:	scottl
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/cam/cam_sim.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/cam/cam_sim.c
==============================================================================
--- stable/7/sys/cam/cam_sim.c	Sat Feb 28 10:33:00 2009	(r189147)
+++ stable/7/sys/cam/cam_sim.c	Sat Feb 28 10:35:30 2009	(r189148)
@@ -123,9 +123,10 @@ void
 cam_sim_release(struct cam_sim *sim)
 {
 	KASSERT(sim->refcount >= 1, ("sim->refcount >= 1"));
+	mtx_assert(sim->mtx, MA_OWNED);
 
 	sim->refcount--;
-	if (sim->refcount <= 1)
+	if (sim->refcount == 0)
 		wakeup(sim);
 }
 
@@ -133,6 +134,7 @@ void
 cam_sim_hold(struct cam_sim *sim)
 {
 	KASSERT(sim->refcount >= 1, ("sim->refcount >= 1"));
+	mtx_assert(sim->mtx, MA_OWNED);
 
 	sim->refcount++;
 }


More information about the svn-src-all mailing list