Print this page
4374 dn_free_ranges should use range_tree_t
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Max Grossman <max.grossman@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Dan McDonald <danmcd@omniti.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zap.c
          +++ new/usr/src/uts/common/fs/zfs/zap.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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      - * Copyright (c) 2013 by Delphix. All rights reserved.
       23 + * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  24   24   */
  25   25  
  26   26  /*
  27   27   * This file contains the top half of the zfs directory structure
  28   28   * implementation. The bottom half is in zap_leaf.c.
  29   29   *
  30   30   * The zdir is an extendable hash data structure. There is a table of
  31   31   * pointers to buckets (zap_t->zd_data->zd_leafs). The buckets are
  32   32   * each a constant size and hold a variable number of directory entries.
  33   33   * The buckets (aka "leaf nodes") are implemented in zap_leaf.c.
↓ open down ↓ 43 lines elided ↑ open up ↑
  77   77          int i;
  78   78          zap_phys_t *zp;
  79   79  
  80   80          ASSERT(RW_WRITE_HELD(&zap->zap_rwlock));
  81   81          zap->zap_ismicro = FALSE;
  82   82  
  83   83          (void) dmu_buf_update_user(zap->zap_dbuf, zap, zap,
  84   84              &zap->zap_f.zap_phys, zap_evict);
  85   85  
  86   86          mutex_init(&zap->zap_f.zap_num_entries_mtx, 0, 0, 0);
  87      -        zap->zap_f.zap_block_shift = highbit(zap->zap_dbuf->db_size) - 1;
       87 +        zap->zap_f.zap_block_shift = highbit64(zap->zap_dbuf->db_size) - 1;
  88   88  
  89   89          zp = zap->zap_f.zap_phys;
  90   90          /*
  91   91           * explicitly zero it since it might be coming from an
  92   92           * initialized microzap
  93   93           */
  94   94          bzero(zap->zap_dbuf->db_data, zap->zap_dbuf->db_size);
  95   95          zp->zap_block_type = ZBT_HEADER;
  96   96          zp->zap_magic = ZAP_MAGIC;
  97   97  
↓ open down ↓ 353 lines elided ↑ open up ↑
 451  451  zap_open_leaf(uint64_t blkid, dmu_buf_t *db)
 452  452  {
 453  453          zap_leaf_t *l, *winner;
 454  454  
 455  455          ASSERT(blkid != 0);
 456  456  
 457  457          l = kmem_alloc(sizeof (zap_leaf_t), KM_SLEEP);
 458  458          rw_init(&l->l_rwlock, 0, 0, 0);
 459  459          rw_enter(&l->l_rwlock, RW_WRITER);
 460  460          l->l_blkid = blkid;
 461      -        l->l_bs = highbit(db->db_size)-1;
      461 +        l->l_bs = highbit64(db->db_size) - 1;
 462  462          l->l_dbuf = db;
 463  463          l->l_phys = NULL;
 464  464  
 465  465          winner = dmu_buf_set_user(db, l, &l->l_phys, zap_leaf_pageout);
 466  466  
 467  467          rw_exit(&l->l_rwlock);
 468  468          if (winner != NULL) {
 469  469                  /* someone else set it first */
 470  470                  zap_leaf_pageout(NULL, l);
 471  471                  l = winner;
↓ open down ↓ 892 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX