]> git.proxmox.com Git - mirror_zfs.git/commitdiff
FreeBSD: Don't require zeroing new locks before init
authorRyan Moeller <ryan@iXsystems.com>
Sat, 13 Jun 2020 17:58:10 +0000 (13:58 -0400)
committerGitHub <noreply@github.com>
Sat, 13 Jun 2020 17:58:10 +0000 (10:58 -0700)
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

include/os/freebsd/spl/sys/mutex.h

index ef556872a2bd857cb256511b930512ab3abd8cf6..e757d12c15020b23eadc903c30086276b9fe2e34 100644 (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;                                          \