Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Oct 2017 07:44:09 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324425 - head/sys/cddl/compat/opensolaris/sys
Message-ID:  <201710090744.v997i977045360@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Mon Oct  9 07:44:09 2017
New Revision: 324425
URL: https://svnweb.freebsd.org/changeset/base/324425

Log:
  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

Modified:
  head/sys/cddl/compat/opensolaris/sys/mutex.h

Modified: head/sys/cddl/compat/opensolaris/sys/mutex.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/mutex.h	Mon Oct  9 05:16:34 2017	(r324424)
+++ head/sys/cddl/compat/opensolaris/sys/mutex.h	Mon Oct  9 07:44:09 2017	(r324425)
@@ -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;						\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710090744.v997i977045360>