Print this page
5056 ZFS deadlock on db_mtx and dn_holds
Reviewed by: Will Andrews <willa@spectralogic.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/zap_impl.h
          +++ new/usr/src/uts/common/fs/zfs/sys/zap_impl.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) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2013 by Delphix. All rights reserved.
       24 + * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  24   25   */
  25   26  
  26   27  #ifndef _SYS_ZAP_IMPL_H
  27   28  #define _SYS_ZAP_IMPL_H
  28   29  
  29   30  #include <sys/zap.h>
  30   31  #include <sys/zfs_context.h>
  31   32  #include <sys/avl.h>
  32   33  
  33   34  #ifdef  __cplusplus
↓ open down ↓ 99 lines elided ↑ open up ↑
 133  134           * This structure is followed by padding, and then the embedded
 134  135           * pointer table.  The embedded pointer table takes up second
 135  136           * half of the block.  It is accessed using the
 136  137           * ZAP_EMBEDDED_PTRTBL_ENT() macro.
 137  138           */
 138  139  } zap_phys_t;
 139  140  
 140  141  typedef struct zap_table_phys zap_table_phys_t;
 141  142  
 142  143  typedef struct zap {
      144 +        dmu_buf_user_t zap_dbu;
 143  145          objset_t *zap_objset;
 144  146          uint64_t zap_object;
 145  147          struct dmu_buf *zap_dbuf;
 146  148          krwlock_t zap_rwlock;
 147  149          boolean_t zap_ismicro;
 148  150          int zap_normflags;
 149  151          uint64_t zap_salt;
 150  152          union {
 151  153                  struct {
 152  154                          /*
↓ open down ↓ 36 lines elided ↑ open up ↑
 189  191          char zn_normbuf[ZAP_MAXNAMELEN];
 190  192  } zap_name_t;
 191  193  
 192  194  #define zap_f   zap_u.zap_fat
 193  195  #define zap_m   zap_u.zap_micro
 194  196  
 195  197  boolean_t zap_match(zap_name_t *zn, const char *matchname);
 196  198  int zap_lockdir(objset_t *os, uint64_t obj, dmu_tx_t *tx,
 197  199      krw_t lti, boolean_t fatreader, boolean_t adding, zap_t **zapp);
 198  200  void zap_unlockdir(zap_t *zap);
 199      -void zap_evict(dmu_buf_t *db, void *vmzap);
      201 +void zap_evict(void *dbu);
 200  202  zap_name_t *zap_name_alloc(zap_t *zap, const char *key, matchtype_t mt);
 201  203  void zap_name_free(zap_name_t *zn);
 202  204  int zap_hashbits(zap_t *zap);
 203  205  uint32_t zap_maxcd(zap_t *zap);
 204  206  uint64_t zap_getflags(zap_t *zap);
 205  207  
 206  208  #define ZAP_HASH_IDX(hash, n) (((n) == 0) ? 0 : ((hash) >> (64 - (n))))
 207  209  
 208  210  void fzap_byteswap(void *buf, size_t size);
 209  211  int fzap_count(zap_t *zap, uint64_t *count);
↓ open down ↓ 27 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX