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
This commit is contained in:
Andriy Gapon 2017-10-09 07:44:09 +00:00
parent 45d9a9bef7
commit 1dce7acd37
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=324425

View File

@ -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; \