Print this page
2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>
Approved by: Dan McDonald <danmcd@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/fs/zfs.h
          +++ new/usr/src/uts/common/sys/fs/zfs.h
↓ open down ↓ 161 lines elided ↑ open up ↑
 162  162          ZPOOL_PROP_FAILUREMODE,
 163  163          ZPOOL_PROP_LISTSNAPS,
 164  164          ZPOOL_PROP_AUTOEXPAND,
 165  165          ZPOOL_PROP_DEDUPDITTO,
 166  166          ZPOOL_PROP_DEDUPRATIO,
 167  167          ZPOOL_PROP_FREE,
 168  168          ZPOOL_PROP_ALLOCATED,
 169  169          ZPOOL_PROP_READONLY,
 170  170          ZPOOL_PROP_COMMENT,
 171  171          ZPOOL_PROP_EXPANDSZ,
      172 +        ZPOOL_PROP_FREEING,
 172  173          ZPOOL_NUM_PROPS
 173  174  } zpool_prop_t;
 174  175  
 175  176  /* Small enough to not hog a whole line of printout in zpool(1M). */
 176  177  #define ZPROP_MAX_COMMENT       32
 177  178  
 178  179  #define ZPROP_CONT              -2
 179  180  #define ZPROP_INVAL             -1
 180  181  
 181  182  #define ZPROP_VALUE             "value"
↓ open down ↓ 54 lines elided ↑ open up ↑
 236  237  boolean_t zfs_prop_valid_for_type(int, zfs_type_t);
 237  238  
 238  239  /*
 239  240   * Pool property functions shared between libzfs and kernel.
 240  241   */
 241  242  zpool_prop_t zpool_name_to_prop(const char *);
 242  243  const char *zpool_prop_to_name(zpool_prop_t);
 243  244  const char *zpool_prop_default_string(zpool_prop_t);
 244  245  uint64_t zpool_prop_default_numeric(zpool_prop_t);
 245  246  boolean_t zpool_prop_readonly(zpool_prop_t);
      247 +boolean_t zpool_prop_feature(const char *);
      248 +boolean_t zpool_prop_unsupported(const char *name);
 246  249  int zpool_prop_index_to_string(zpool_prop_t, uint64_t, const char **);
 247  250  int zpool_prop_string_to_index(zpool_prop_t, const char *, uint64_t *);
 248  251  uint64_t zpool_prop_random_value(zpool_prop_t, uint64_t seed);
 249  252  
 250  253  /*
 251  254   * Definitions for the Delegation.
 252  255   */
 253  256  typedef enum {
 254  257          ZFS_DELEG_WHO_UNKNOWN = 0,
 255  258          ZFS_DELEG_USER = 'u',
↓ open down ↓ 87 lines elided ↑ open up ↑
 343  346  #define SPA_VERSION_19                  19ULL
 344  347  #define SPA_VERSION_20                  20ULL
 345  348  #define SPA_VERSION_21                  21ULL
 346  349  #define SPA_VERSION_22                  22ULL
 347  350  #define SPA_VERSION_23                  23ULL
 348  351  #define SPA_VERSION_24                  24ULL
 349  352  #define SPA_VERSION_25                  25ULL
 350  353  #define SPA_VERSION_26                  26ULL
 351  354  #define SPA_VERSION_27                  27ULL
 352  355  #define SPA_VERSION_28                  28ULL
      356 +#define SPA_VERSION_5000                5000ULL
 353  357  
 354  358  /*
 355  359   * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk
 356  360   * format change. Go to usr/src/grub/grub-0.97/stage2/{zfs-include/, fsys_zfs*},
 357  361   * and do the appropriate changes.  Also bump the version number in
 358  362   * usr/src/grub/capability.
 359  363   */
 360      -#define SPA_VERSION                     SPA_VERSION_28
 361      -#define SPA_VERSION_STRING              "28"
      364 +#define SPA_VERSION                     SPA_VERSION_5000
      365 +#define SPA_VERSION_STRING              "5000"
 362  366  
 363  367  /*
 364  368   * Symbolic names for the changes that caused a SPA_VERSION switch.
 365  369   * Used in the code when checking for presence or absence of a feature.
 366  370   * Feel free to define multiple symbolic names for each version if there
 367  371   * were multiple changes to on-disk structures during that version.
 368  372   *
 369  373   * NOTE: When checking the current SPA_VERSION in your code, be sure
 370  374   *       to use spa_version() since it reports the version of the
 371  375   *       last synced uberblock.  Checking the in-flight version can
↓ open down ↓ 30 lines elided ↑ open up ↑
 402  406  #define SPA_VERSION_ZLE_COMPRESSION     SPA_VERSION_20
 403  407  #define SPA_VERSION_DEDUP               SPA_VERSION_21
 404  408  #define SPA_VERSION_RECVD_PROPS         SPA_VERSION_22
 405  409  #define SPA_VERSION_SLIM_ZIL            SPA_VERSION_23
 406  410  #define SPA_VERSION_SA                  SPA_VERSION_24
 407  411  #define SPA_VERSION_SCAN                SPA_VERSION_25
 408  412  #define SPA_VERSION_DIR_CLONES          SPA_VERSION_26
 409  413  #define SPA_VERSION_DEADLISTS           SPA_VERSION_26
 410  414  #define SPA_VERSION_FAST_SNAP           SPA_VERSION_27
 411  415  #define SPA_VERSION_MULTI_REPLACE       SPA_VERSION_28
      416 +#define SPA_VERSION_BEFORE_FEATURES     SPA_VERSION_28
      417 +#define SPA_VERSION_FEATURES            SPA_VERSION_5000
 412  418  
      419 +#define SPA_VERSION_IS_SUPPORTED(v) \
      420 +        (((v) >= SPA_VERSION_INITIAL && (v) <= SPA_VERSION_BEFORE_FEATURES) || \
      421 +        ((v) >= SPA_VERSION_FEATURES && (v) <= SPA_VERSION))
      422 +
 413  423  /*
 414  424   * ZPL version - rev'd whenever an incompatible on-disk format change
 415  425   * occurs.  This is independent of SPA/DMU/ZAP versioning.  You must
 416  426   * also update the version_table[] and help message in zfs_prop.c.
 417  427   *
 418  428   * When changing, be sure to teach GRUB how to read the new format!
 419  429   * See usr/src/grub/grub-0.97/stage2/{zfs-include/,fsys_zfs*}
 420  430   */
 421  431  #define ZPL_VERSION_1                   1ULL
 422  432  #define ZPL_VERSION_2                   2ULL
↓ open down ↓ 76 lines elided ↑ open up ↑
 499  509  #define ZPOOL_CONFIG_SPLIT_GUID         "split_guid"
 500  510  #define ZPOOL_CONFIG_SPLIT_LIST         "guid_list"
 501  511  #define ZPOOL_CONFIG_REMOVING           "removing"
 502  512  #define ZPOOL_CONFIG_RESILVERING        "resilvering"
 503  513  #define ZPOOL_CONFIG_COMMENT            "comment"
 504  514  #define ZPOOL_CONFIG_SUSPENDED          "suspended"     /* not stored on disk */
 505  515  #define ZPOOL_CONFIG_TIMESTAMP          "timestamp"     /* not stored on disk */
 506  516  #define ZPOOL_CONFIG_BOOTFS             "bootfs"        /* not stored on disk */
 507  517  #define ZPOOL_CONFIG_MISSING_DEVICES    "missing_vdevs" /* not stored on disk */
 508  518  #define ZPOOL_CONFIG_LOAD_INFO          "load_info"     /* not stored on disk */
      519 +#define ZPOOL_CONFIG_REWIND_INFO        "rewind_info"   /* not stored on disk */
      520 +#define ZPOOL_CONFIG_UNSUP_FEAT         "unsup_feat"    /* not stored on disk */
      521 +#define ZPOOL_CONFIG_CAN_RDONLY         "can_rdonly"    /* not stored on disk */
      522 +#define ZPOOL_CONFIG_FEATURES_FOR_READ  "features_for_read"
      523 +#define ZPOOL_CONFIG_FEATURE_STATS      "feature_stats" /* not stored on disk */
 509  524  /*
 510  525   * The persistent vdev state is stored as separate values rather than a single
 511  526   * 'vdev_state' entry.  This is because a device can be in multiple states, such
 512  527   * as offline and degraded.
 513  528   */
 514  529  #define ZPOOL_CONFIG_OFFLINE            "offline"
 515  530  #define ZPOOL_CONFIG_FAULTED            "faulted"
 516  531  #define ZPOOL_CONFIG_DEGRADED           "degraded"
 517  532  #define ZPOOL_CONFIG_REMOVED            "removed"
 518  533  #define ZPOOL_CONFIG_FRU                "fru"
↓ open down ↓ 58 lines elided ↑ open up ↑
 577  592  typedef enum vdev_aux {
 578  593          VDEV_AUX_NONE,          /* no error                             */
 579  594          VDEV_AUX_OPEN_FAILED,   /* ldi_open_*() or vn_open() failed     */
 580  595          VDEV_AUX_CORRUPT_DATA,  /* bad label or disk contents           */
 581  596          VDEV_AUX_NO_REPLICAS,   /* insufficient number of replicas      */
 582  597          VDEV_AUX_BAD_GUID_SUM,  /* vdev guid sum doesn't match          */
 583  598          VDEV_AUX_TOO_SMALL,     /* vdev size is too small               */
 584  599          VDEV_AUX_BAD_LABEL,     /* the label is OK but invalid          */
 585  600          VDEV_AUX_VERSION_NEWER, /* on-disk version is too new           */
 586  601          VDEV_AUX_VERSION_OLDER, /* on-disk version is too old           */
      602 +        VDEV_AUX_UNSUP_FEAT,    /* unsupported features                 */
 587  603          VDEV_AUX_SPARED,        /* hot spare used in another pool       */
 588  604          VDEV_AUX_ERR_EXCEEDED,  /* too many errors                      */
 589  605          VDEV_AUX_IO_FAILURE,    /* experienced I/O failure              */
 590  606          VDEV_AUX_BAD_LOG,       /* cannot read log chain(s)             */
 591  607          VDEV_AUX_EXTERNAL,      /* external diagnosis                   */
 592  608          VDEV_AUX_SPLIT_POOL     /* vdev was split off into another pool */
 593  609  } vdev_aux_t;
 594  610  
 595  611  /*
 596  612   * pool state.  The following states are written to disk as part of the normal
↓ open down ↓ 336 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX