diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2008-12-19 14:33:29 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2008-12-19 14:33:29 +0000 |
commit | 7412d60d0b7624d6f25ee15654b5d20887ebcd11 (patch) | |
tree | 54d50808fb43d1ba6e5fe184ccfc2b6112150959 /sys/cam/cam_sim.c | |
parent | 24ebf566361c2ccb092a24caa3564bb2ebd20a10 (diff) | |
download | src-7412d60d0b7624d6f25ee15654b5d20887ebcd11.tar.gz src-7412d60d0b7624d6f25ee15654b5d20887ebcd11.zip |
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
Notes
Notes:
svn path=/head/; revision=186320
Diffstat (limited to 'sys/cam/cam_sim.c')
-rw-r--r-- | sys/cam/cam_sim.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/cam/cam_sim.c b/sys/cam/cam_sim.c index d7fcaad1afa7..adccfa8593ec 100644 --- a/sys/cam/cam_sim.c +++ b/sys/cam/cam_sim.c @@ -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++; } |