Print this page
8115 parallel zfs mount

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libfakekernel/common/mutex.c
          +++ new/usr/src/lib/libfakekernel/common/mutex.c
↓ open down ↓ 3 lines elided ↑ open up ↑
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13   13   * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       14 + * Copyright 2017 RackTop Systems.
  14   15   */
  15   16  
  16   17  /*
  17   18   * mutex(9f)
  18   19   */
  19   20  
  20   21  /* This is the API we're emulating */
  21   22  #include <sys/mutex.h>
  22   23  
  23   24  #include <sys/errno.h>
↓ open down ↓ 20 lines elided ↑ open up ↑
  44   45  }
  45   46  
  46   47  /* ARGSUSED */
  47   48  void
  48   49  kmutex_destroy(kmutex_t *mp)
  49   50  {
  50   51          mp->m_owner = _KTHREAD_INVALID;
  51   52  }
  52   53  
  53   54  void
  54      -mutex_enter(kmutex_t *mp)
       55 +kmutex_enter(kmutex_t *mp)
  55   56  {
  56   57          VERIFY(0 == _lwp_mutex_lock(&mp->m_lock));
  57   58          mp->m_owner = _curthread();
  58   59  }
  59   60  
  60   61  int
  61   62  mutex_tryenter(kmutex_t *mp)
  62   63  {
  63   64          int rc;
  64   65  
  65   66          rc = _lwp_mutex_trylock(&mp->m_lock);
  66   67          if (rc == 0) {
  67   68                  mp->m_owner = _curthread();
  68   69                  return (1);
  69   70          }
  70   71          return (0);
  71   72  }
  72   73  
  73   74  void
  74      -mutex_exit(kmutex_t *mp)
       75 +kmutex_exit(kmutex_t *mp)
  75   76  {
  76   77          ASSERT(mp->m_owner == _curthread());
  77   78          mp->m_owner = _KTHREAD_INVALID;
  78   79          (void) _lwp_mutex_unlock(&mp->m_lock);
  79   80  }
  80   81  
  81   82  /*
  82   83   * Returns the kthread_t * of the owner.
  83   84   */
  84   85  void *
↓ open down ↓ 11 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX