From 1dce7acd3730bcb0fc5754b794c8190797d0fa04 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Mon, 9 Oct 2017 07:44:09 +0000 Subject: [PATCH] illumos mutex_init: use SX_NEW instead of bzero There should be no functional change, but SX_NEW seems to be more idiomatic to the use-case. MFC after: 2 weeks X-MFC note: stable/11 only --- sys/cddl/compat/opensolaris/sys/mutex.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/cddl/compat/opensolaris/sys/mutex.h b/sys/cddl/compat/opensolaris/sys/mutex.h index b1982e7245b0..9875901242e0 100644 --- a/sys/cddl/compat/opensolaris/sys/mutex.h +++ b/sys/cddl/compat/opensolaris/sys/mutex.h @@ -47,9 +47,9 @@ typedef enum { typedef struct sx kmutex_t; #ifndef OPENSOLARIS_WITNESS -#define MUTEX_FLAGS (SX_DUPOK | SX_NOWITNESS) +#define MUTEX_FLAGS (SX_DUPOK | SX_NEW | SX_NOWITNESS) #else -#define MUTEX_FLAGS (SX_DUPOK) +#define MUTEX_FLAGS (SX_DUPOK | SX_NEW) #endif #define mutex_init(lock, desc, type, arg) do { \ @@ -57,7 +57,6 @@ typedef struct sx kmutex_t; ASSERT((type) == 0 || (type) == MUTEX_DEFAULT); \ KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \ LO_EXPECTED, ("lock %s already initialized", #lock)); \ - bzero((lock), sizeof(struct sx)); \ for (_name = #lock; *_name != '\0'; _name++) { \ if (*_name >= 'a' && *_name <= 'z') \ break; \