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 <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Allan Jude <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes openzfs#10449
  • Loading branch information
Ryan Moeller authored and RageLtMan committed May 31, 2021
1 parent 1f66033 commit 780f335
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 780f335

Please sign in to comment.