Print this page
8115 parallel zfs mount

@@ -19,10 +19,11 @@
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2017 RackTop Systems.
  */
 
 #ifndef _SYS_MUTEX_H
 #define _SYS_MUTEX_H
 

@@ -71,10 +72,12 @@
         char            pad_pad[64 - sizeof (kmutex_t)];
 #endif
 } pad_mutex_t;
 #endif  /* _KERNEL */
 
+extern char *volatile panicstr;  /* panic string pointer */
+
 #define MUTEX_HELD(x)           (mutex_owned(x))
 #define MUTEX_NOT_HELD(x)       (!mutex_owned(x) || panicstr)
 
 /*
  * We're simulating the kernel mutex API here, and the

@@ -81,16 +84,24 @@
  * user-level has a different signature, so rename.
  */
 #define mutex_init      kmutex_init
 #define mutex_destroy   kmutex_destroy
 
+/*
+ * We want to avoid binding against the versions of these
+ * functions in libc which causes bad things to happen.
+ */
+#define mutex_enter     kmutex_enter
+#define mutex_exit      kmutex_exit
+
 extern  void    kmutex_init(kmutex_t *, char *, kmutex_type_t, void *);
 extern  void    kmutex_destroy(kmutex_t *);
 
-extern  void    mutex_enter(kmutex_t *);
+extern  void    kmutex_enter(kmutex_t *);
+extern  void    kmutex_exit(kmutex_t *);
+
 extern  int     mutex_tryenter(kmutex_t *);
-extern  void    mutex_exit(kmutex_t *);
 extern  int     mutex_owned(const kmutex_t *);
 
 extern  void *mutex_owner(const kmutex_t *);
 
 #ifdef  __cplusplus