Print this page
8115 parallel zfs mount

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libfakekernel/common/sys/mutex.h
          +++ new/usr/src/lib/libfakekernel/common/sys/mutex.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       24 + * Copyright 2017 RackTop Systems.
  24   25   */
  25   26  
  26   27  #ifndef _SYS_MUTEX_H
  27   28  #define _SYS_MUTEX_H
  28   29  
  29   30  #include <sys/synch.h>  /* lwp_mutex_t */
  30   31  
  31   32  #ifdef  __cplusplus
  32   33  extern "C" {
  33   34  #endif
↓ open down ↓ 32 lines elided ↑ open up ↑
  66   67  #if defined(_KERNEL) || defined(_FAKE_KERNEL)
  67   68  /* See the real sys/mutex.h */
  68   69  typedef struct pad_mutex {
  69   70          kmutex_t        pad_mutex;
  70   71  #ifdef _LP64
  71   72          char            pad_pad[64 - sizeof (kmutex_t)];
  72   73  #endif
  73   74  } pad_mutex_t;
  74   75  #endif  /* _KERNEL */
  75   76  
       77 +extern char *volatile panicstr;  /* panic string pointer */
       78 +
  76   79  #define MUTEX_HELD(x)           (mutex_owned(x))
  77   80  #define MUTEX_NOT_HELD(x)       (!mutex_owned(x) || panicstr)
  78   81  
  79   82  /*
  80   83   * We're simulating the kernel mutex API here, and the
  81   84   * user-level has a different signature, so rename.
  82   85   */
  83   86  #define mutex_init      kmutex_init
  84   87  #define mutex_destroy   kmutex_destroy
  85   88  
       89 +/*
       90 + * We want to avoid binding against the versions of these
       91 + * functions in libc which causes bad things to happen.
       92 + */
       93 +#define mutex_enter     kmutex_enter
       94 +#define mutex_exit      kmutex_exit
       95 +
  86   96  extern  void    kmutex_init(kmutex_t *, char *, kmutex_type_t, void *);
  87   97  extern  void    kmutex_destroy(kmutex_t *);
  88   98  
  89      -extern  void    mutex_enter(kmutex_t *);
       99 +extern  void    kmutex_enter(kmutex_t *);
      100 +extern  void    kmutex_exit(kmutex_t *);
      101 +
  90  102  extern  int     mutex_tryenter(kmutex_t *);
  91      -extern  void    mutex_exit(kmutex_t *);
  92  103  extern  int     mutex_owned(const kmutex_t *);
  93  104  
  94  105  extern  void *mutex_owner(const kmutex_t *);
  95  106  
  96  107  #ifdef  __cplusplus
  97  108  }
  98  109  #endif
  99  110  
 100  111  #endif  /* _SYS_MUTEX_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX