summaryrefslogtreecommitdiffstats
path: root/sys/cddl/compat/opensolaris/sys/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cddl/compat/opensolaris/sys/mutex.h')
-rw-r--r--sys/cddl/compat/opensolaris/sys/mutex.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/mutex.h b/sys/cddl/compat/opensolaris/sys/mutex.h
index 14e69c4..dac7249 100644
--- a/sys/cddl/compat/opensolaris/sys/mutex.h
+++ b/sys/cddl/compat/opensolaris/sys/mutex.h
@@ -48,6 +48,9 @@ typedef struct sx kmutex_t;
#define mutex_init(lock, desc, type, arg) do { \
ASSERT((type) == MUTEX_DEFAULT); \
+ KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \
+ LO_EXPECTED, ("lock %s already initialized", #lock)); \
+ bzero((lock), sizeof(struct sx)); \
sx_init_flags((lock), "zfs:" #lock, SX_DUPOK); \
} while (0)
#define mutex_destroy(lock) sx_destroy(lock)
OpenPOWER on IntegriCloud