Skip to content

Commit

Permalink
FreeBSD: Don't require zeroing new locks before init
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ryan Moeller authored and lundman committed Jun 19, 2020
1 parent 14da083 commit f7ca3a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/os/freebsd/spl/sys/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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; \
Expand Down

0 comments on commit f7ca3a9

Please sign in to comment.