Print this page
8115 parallel zfs mount

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzfs/common/libzfs_impl.h
          +++ new/usr/src/lib/libzfs/common/libzfs_impl.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  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  /*
  23   23   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved.
  25      - * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
       25 + * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
  26   26   */
  27   27  
  28   28  #ifndef _LIBZFS_IMPL_H
  29   29  #define _LIBZFS_IMPL_H
  30   30  
  31   31  #include <sys/fs/zfs.h>
  32   32  #include <sys/spa.h>
  33   33  #include <sys/nvpair.h>
  34   34  #include <sys/dmu.h>
  35   35  #include <sys/zfs_ioctl.h>
       36 +#include <synch.h>
  36   37  
  37   38  #include <libuutil.h>
  38   39  #include <libzfs.h>
  39   40  #include <libshare.h>
  40   41  #include <libzfs_core.h>
  41   42  
  42   43  #include <fm/libtopo.h>
  43   44  
  44   45  #ifdef  __cplusplus
  45   46  extern "C" {
↓ open down ↓ 20 lines elided ↑ open up ↑
  66   67          uu_avl_pool_t *libzfs_ns_avlpool;
  67   68          uu_avl_t *libzfs_ns_avl;
  68   69          uint64_t libzfs_ns_gen;
  69   70          int libzfs_desc_active;
  70   71          char libzfs_action[1024];
  71   72          char libzfs_desc[1024];
  72   73          int libzfs_printerr;
  73   74          int libzfs_storeerr; /* stuff error messages into buffer */
  74   75          void *libzfs_sharehdl; /* libshare handle */
  75   76          boolean_t libzfs_mnttab_enable;
       77 +        /*
       78 +         * We need a lock to handle the case where parallel mount threads
       79 +         * are populating the mnttab cache simultaneously. The lock only
       80 +         * protects the integrity of of the avl tree, and does not protect
       81 +         * the contents of the mnttab entries themselves.
       82 +         */
       83 +        mutex_t libzfs_mnttab_cache_lock;
  76   84          avl_tree_t libzfs_mnttab_cache;
  77   85          int libzfs_pool_iter;
  78   86          topo_hdl_t *libzfs_topo_hdl;
  79   87          libzfs_fru_t **libzfs_fru_hash;
  80   88          libzfs_fru_t *libzfs_fru_list;
  81   89          char libzfs_chassis_id[256];
  82   90          boolean_t libzfs_prop_debug;
  83   91  };
  84   92  
  85   93  struct zfs_handle {
↓ open down ↓ 133 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX