FreeBSD: Don't require zeroing new locks before init

This has not shown to be of use enough to justify the inconvenience.

Reviewed-by: Matt Macy <mmacy@FreeBSD.org>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Allan Jude <allanjude@freebsd.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10449
This commit is contained in:
Ryan Moeller 2020-06-13 13:58:10 -04:00 committed by GitHub
parent e08b993396
commit 499dccd69b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ typedef struct sx kmutex_t;
#include <sys/sx.h>
typedef enum {
MUTEX_DEFAULT = 6 /* kernel default mutex */
MUTEX_DEFAULT = 0 /* kernel default mutex */
} kmutex_type_t;
#define MUTEX_HELD(x) (mutex_owned(x))
@ -53,9 +53,7 @@ typedef enum {
#define mutex_init(lock, desc, type, arg) do { \
const char *_name; \
ASSERT((type) == 0 || (type) == MUTEX_DEFAULT); \
KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \
LO_EXPECTED, ("lock %s already initialized", #lock)); \
ASSERT((type) == MUTEX_DEFAULT); \
for (_name = #lock; *_name != '\0'; _name++) { \
if (*_name >= 'a' && *_name <= 'z') \
break; \