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/lib/libzpool/common/kernel.c
          +++ new/usr/src/lib/libzpool/common/kernel.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) 2012 by Delphix. All rights reserved.
       23 + * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  24   24   * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
  25   25   */
  26   26  
  27   27  #include <assert.h>
  28   28  #include <fcntl.h>
  29   29  #include <poll.h>
  30   30  #include <stdio.h>
  31   31  #include <stdlib.h>
  32   32  #include <string.h>
  33   33  #include <zlib.h>
↓ open down ↓ 731 lines elided ↑ open up ↑
 765  765  
 766  766  void
 767  767  delay(clock_t ticks)
 768  768  {
 769  769          poll(0, 0, ticks * (1000 / hz));
 770  770  }
 771  771  
 772  772  /*
 773  773   * Find highest one bit set.
 774  774   *      Returns bit number + 1 of highest bit that is set, otherwise returns 0.
 775      - * High order bit is 31 (or 63 in _LP64 kernel).
 776  775   */
 777  776  int
 778      -highbit(ulong_t i)
      777 +highbit64(uint64_t i)
 779  778  {
 780      -        register int h = 1;
      779 +        int h = 1;
 781  780  
 782  781          if (i == 0)
 783  782                  return (0);
 784      -#ifdef _LP64
 785      -        if (i & 0xffffffff00000000ul) {
      783 +        if (i & 0xffffffff00000000ULL) {
 786  784                  h += 32; i >>= 32;
 787  785          }
 788      -#endif
 789  786          if (i & 0xffff0000) {
 790  787                  h += 16; i >>= 16;
 791  788          }
 792  789          if (i & 0xff00) {
 793  790                  h += 8; i >>= 8;
 794  791          }
 795  792          if (i & 0xf0) {
 796  793                  h += 4; i >>= 4;
 797  794          }
 798  795          if (i & 0xc) {
↓ open down ↓ 332 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX