Print this page
5255 uts shouldn't open-code ISP2

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zio.c
          +++ new/usr/src/uts/common/fs/zfs/zio.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  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) 2011, 2014 by Delphix. All rights reserved.
  24   24   * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
  25   25   */
  26   26  
       27 +#include <sys/sysmacros.h>
  27   28  #include <sys/zfs_context.h>
  28   29  #include <sys/fm/fs/zfs.h>
  29   30  #include <sys/spa.h>
  30   31  #include <sys/txg.h>
  31   32  #include <sys/spa_impl.h>
  32   33  #include <sys/vdev_impl.h>
  33   34  #include <sys/zio_impl.h>
  34   35  #include <sys/zio_compress.h>
  35   36  #include <sys/zio_checksum.h>
  36   37  #include <sys/dmu_objset.h>
↓ open down ↓ 75 lines elided ↑ open up ↑
 112  113           * SPA_MINBLOCKSIZE.  For medium-size buffers, we want a cache
 113  114           * for each quarter-power of 2.  For large buffers, we want
 114  115           * a cache for each multiple of PAGESIZE.
 115  116           */
 116  117          for (c = 0; c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT; c++) {
 117  118                  size_t size = (c + 1) << SPA_MINBLOCKSHIFT;
 118  119                  size_t p2 = size;
 119  120                  size_t align = 0;
 120  121                  size_t cflags = (size > zio_buf_debug_limit) ? KMC_NODEBUG : 0;
 121  122  
 122      -                while (p2 & (p2 - 1))
      123 +                while (!ISP2(p2))
 123  124                          p2 &= p2 - 1;
 124  125  
 125  126  #ifndef _KERNEL
 126  127                  /*
 127  128                   * If we are using watchpoints, put each buffer on its own page,
 128  129                   * to eliminate the performance overhead of trapping to the
 129  130                   * kernel when modifying a non-watched buffer that shares the
 130  131                   * page with a watched buffer.
 131  132                   */
 132  133                  if (arc_watch && !IS_P2ALIGNED(size, PAGESIZE))
↓ open down ↓ 3118 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX