Print this page
3525 Persistent L2ARC

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/spa.h
          +++ new/usr/src/uts/common/fs/zfs/sys/spa.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  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) 2012 by Delphix. All rights reserved.
  24   24   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
       25 + * Copyright 2013 Saso Kiselkov. All rights reserved.
  25   26   */
  26   27  
  27   28  #ifndef _SYS_SPA_H
  28   29  #define _SYS_SPA_H
  29   30  
  30   31  #include <sys/avl.h>
  31   32  #include <sys/zfs_context.h>
  32   33  #include <sys/nvpair.h>
  33   34  #include <sys/sysmacros.h>
  34   35  #include <sys/types.h>
↓ open down ↓ 250 lines elided ↑ open up ↑
 285  286          DVA_EQUAL(&(bp1)->blk_dva[0], &(bp2)->blk_dva[0]) &&    \
 286  287          DVA_EQUAL(&(bp1)->blk_dva[1], &(bp2)->blk_dva[1]) &&    \
 287  288          DVA_EQUAL(&(bp1)->blk_dva[2], &(bp2)->blk_dva[2]))
 288  289  
 289  290  #define ZIO_CHECKSUM_EQUAL(zc1, zc2) \
 290  291          (0 == (((zc1).zc_word[0] - (zc2).zc_word[0]) | \
 291  292          ((zc1).zc_word[1] - (zc2).zc_word[1]) | \
 292  293          ((zc1).zc_word[2] - (zc2).zc_word[2]) | \
 293  294          ((zc1).zc_word[3] - (zc2).zc_word[3])))
 294  295  
      296 +#define ZIO_CHECKSUM_BSWAP(_zc) \
      297 +        do { \
      298 +                zio_cksum_t *zc = (_zc); \
      299 +                zc->zc_word[0] = BSWAP_64(zc->zc_word[0]); \
      300 +                zc->zc_word[1] = BSWAP_64(zc->zc_word[1]); \
      301 +                zc->zc_word[2] = BSWAP_64(zc->zc_word[2]); \
      302 +                zc->zc_word[3] = BSWAP_64(zc->zc_word[3]); \
      303 +                _NOTE(NOTREACHED) \
      304 +                _NOTE(CONSTCOND) \
      305 +        } while (0)
      306 +
 295  307  #define DVA_IS_VALID(dva)       (DVA_GET_ASIZE(dva) != 0)
 296  308  
 297  309  #define ZIO_SET_CHECKSUM(zcp, w0, w1, w2, w3)   \
 298  310  {                                               \
 299  311          (zcp)->zc_word[0] = w0;                 \
 300  312          (zcp)->zc_word[1] = w1;                 \
 301  313          (zcp)->zc_word[2] = w2;                 \
 302  314          (zcp)->zc_word[3] = w3;                 \
 303  315  }
 304  316  
↓ open down ↓ 125 lines elided ↑ open up ↑
 430  442  extern int spa_reset(char *pool);
 431  443  extern void spa_async_request(spa_t *spa, int flag);
 432  444  extern void spa_async_unrequest(spa_t *spa, int flag);
 433  445  extern void spa_async_suspend(spa_t *spa);
 434  446  extern void spa_async_resume(spa_t *spa);
 435  447  extern spa_t *spa_inject_addref(char *pool);
 436  448  extern void spa_inject_delref(spa_t *spa);
 437  449  extern void spa_scan_stat_init(spa_t *spa);
 438  450  extern int spa_scan_get_stats(spa_t *spa, pool_scan_stat_t *ps);
 439  451  
 440      -#define SPA_ASYNC_CONFIG_UPDATE 0x01
 441      -#define SPA_ASYNC_REMOVE        0x02
 442      -#define SPA_ASYNC_PROBE         0x04
 443      -#define SPA_ASYNC_RESILVER_DONE 0x08
 444      -#define SPA_ASYNC_RESILVER      0x10
 445      -#define SPA_ASYNC_AUTOEXPAND    0x20
 446      -#define SPA_ASYNC_REMOVE_DONE   0x40
 447      -#define SPA_ASYNC_REMOVE_STOP   0x80
      452 +#define SPA_ASYNC_CONFIG_UPDATE         0x01
      453 +#define SPA_ASYNC_REMOVE                0x02
      454 +#define SPA_ASYNC_PROBE                 0x04
      455 +#define SPA_ASYNC_RESILVER_DONE         0x08
      456 +#define SPA_ASYNC_RESILVER              0x10
      457 +#define SPA_ASYNC_AUTOEXPAND            0x20
      458 +#define SPA_ASYNC_REMOVE_DONE           0x40
      459 +#define SPA_ASYNC_REMOVE_STOP           0x80
      460 +#define SPA_ASYNC_L2CACHE_REBUILD       0x100
 448  461  
 449  462  /*
 450  463   * Controls the behavior of spa_vdev_remove().
 451  464   */
 452  465  #define SPA_REMOVE_UNSPARE      0x01
 453  466  #define SPA_REMOVE_DONE         0x02
 454  467  
 455  468  /* device manipulation */
 456  469  extern int spa_vdev_add(spa_t *spa, nvlist_t *nvroot);
 457  470  extern int spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot,
↓ open down ↓ 246 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX