diff options
author | pjd <pjd@FreeBSD.org> | 2009-07-09 20:22:05 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2009-07-09 20:22:05 +0000 |
commit | d8377a604cb8480703c77bad2df6defd63f40e2d (patch) | |
tree | 54dec725b287445b7ac09e0a90da06c4f4d0d081 /cddl/contrib/opensolaris/lib/libzpool/common/kernel.c | |
parent | dcfe611845bcded2f3a99bf14db514ce5acf89b8 (diff) | |
download | FreeBSD-src-d8377a604cb8480703c77bad2df6defd63f40e2d.zip FreeBSD-src-d8377a604cb8480703c77bad2df6defd63f40e2d.tar.gz |
The mutex_owned() macro should operate on kmutex_t and not on mutex_t.
This fixes 'zdb <poolname>' crash.
Reported by: avg
Approved by: re (kib)
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzpool/common/kernel.c')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzpool/common/kernel.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c index 467cf5c..a13cd76 100644 --- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c +++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c @@ -115,6 +115,14 @@ zmutex_destroy(kmutex_t *mp) mp->initialized = B_FALSE; } +int +zmutex_owned(kmutex_t *mp) +{ + ASSERT(mp->initialized == B_TRUE); + + return (mp->m_owner == curthread); +} + void mutex_enter(kmutex_t *mp) { |