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/sys/dnode.h
          +++ new/usr/src/uts/common/fs/zfs/sys/dnode.h
↓ 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  #ifndef _SYS_DNODE_H
  27   27  #define _SYS_DNODE_H
  28   28  
  29   29  #include <sys/zfs_context.h>
  30   30  #include <sys/avl.h>
  31   31  #include <sys/spa.h>
  32   32  #include <sys/txg.h>
  33   33  #include <sys/zio.h>
↓ open down ↓ 157 lines elided ↑ open up ↑
 191  191          uint32_t dn_dbufs_count;        /* count of dn_dbufs */
 192  192          /* There are no level-0 blocks of this blkid or higher in dn_dbufs */
 193  193          uint64_t dn_unlisted_l0_blkid;
 194  194  
 195  195          /* protected by os_lock: */
 196  196          list_node_t dn_dirty_link[TXG_SIZE];    /* next on dataset's dirty */
 197  197  
 198  198          /* protected by dn_mtx: */
 199  199          kmutex_t dn_mtx;
 200  200          list_t dn_dirty_records[TXG_SIZE];
 201      -        avl_tree_t dn_ranges[TXG_SIZE];
      201 +        struct range_tree *dn_free_ranges[TXG_SIZE];
 202  202          uint64_t dn_allocated_txg;
 203  203          uint64_t dn_free_txg;
 204  204          uint64_t dn_assigned_txg;
 205  205          kcondvar_t dn_notxholds;
 206  206          enum dnode_dirtycontext dn_dirtyctx;
 207  207          uint8_t *dn_dirtyctx_firstset;          /* dbg: contents meaningless */
 208  208  
 209  209          /* protected by own devices */
 210  210          refcount_t dn_tx_holds;
 211  211          refcount_t dn_holds;
↓ open down ↓ 61 lines elided ↑ open up ↑
 273  273  void dnode_allocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, int ibs,
 274  274      dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx);
 275  275  void dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize,
 276  276      dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx);
 277  277  void dnode_free(dnode_t *dn, dmu_tx_t *tx);
 278  278  void dnode_byteswap(dnode_phys_t *dnp);
 279  279  void dnode_buf_byteswap(void *buf, size_t size);
 280  280  void dnode_verify(dnode_t *dn);
 281  281  int dnode_set_blksz(dnode_t *dn, uint64_t size, int ibs, dmu_tx_t *tx);
 282  282  void dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx);
 283      -void dnode_clear_range(dnode_t *dn, uint64_t blkid,
 284      -    uint64_t nblks, dmu_tx_t *tx);
 285  283  void dnode_diduse_space(dnode_t *dn, int64_t space);
 286  284  void dnode_willuse_space(dnode_t *dn, int64_t space, dmu_tx_t *tx);
 287  285  void dnode_new_blkid(dnode_t *dn, uint64_t blkid, dmu_tx_t *tx, boolean_t);
 288  286  uint64_t dnode_block_freed(dnode_t *dn, uint64_t blkid);
 289  287  void dnode_init(void);
 290  288  void dnode_fini(void);
 291  289  int dnode_next_offset(dnode_t *dn, int flags, uint64_t *off,
 292  290      int minlvl, uint64_t blkfill, uint64_t txg);
 293  291  void dnode_evict_dbufs(dnode_t *dn);
 294  292  
↓ open down ↓ 37 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX