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/lib/libzfs/common/libzfs.h
          +++ new/usr/src/lib/libzfs/common/libzfs.h
↓ open down ↓ 283 lines elided ↑ open up ↑
 284  284          ZPOOL_STATUS_CORRUPT_POOL,      /* pool metadata is corrupted */
 285  285          ZPOOL_STATUS_CORRUPT_DATA,      /* data errors in user (meta)data */
 286  286          ZPOOL_STATUS_FAILING_DEV,       /* device experiencing errors */
 287  287          ZPOOL_STATUS_VERSION_NEWER,     /* newer on-disk version */
 288  288          ZPOOL_STATUS_HOSTID_MISMATCH,   /* last accessed by another system */
 289  289          ZPOOL_STATUS_IO_FAILURE_WAIT,   /* failed I/O, failmode 'wait' */
 290  290          ZPOOL_STATUS_IO_FAILURE_CONTINUE, /* failed I/O, failmode 'continue' */
 291  291          ZPOOL_STATUS_BAD_LOG,           /* cannot read log chain(s) */
 292  292  
 293  293          /*
      294 +         * If the pool has unsupported features but can still be opened in
      295 +         * read-only mode, its status is ZPOOL_STATUS_UNSUP_FEAT_WRITE. If the
      296 +         * pool has unsupported features but cannot be opened at all, its
      297 +         * status is ZPOOL_STATUS_UNSUP_FEAT_READ.
      298 +         */
      299 +        ZPOOL_STATUS_UNSUP_FEAT_READ,   /* unsupported features for read */
      300 +        ZPOOL_STATUS_UNSUP_FEAT_WRITE,  /* unsupported features for write */
      301 +
      302 +        /*
 294  303           * These faults have no corresponding message ID.  At the time we are
 295  304           * checking the status, the original reason for the FMA fault (I/O or
 296  305           * checksum errors) has been lost.
 297  306           */
 298  307          ZPOOL_STATUS_FAULTED_DEV_R,     /* faulted device with replicas */
 299  308          ZPOOL_STATUS_FAULTED_DEV_NR,    /* faulted device with no replicas */
 300  309  
 301  310          /*
 302  311           * The following are not faults per se, but still an error possibly
 303  312           * requiring administrative attention.  There is no corresponding
↓ open down ↓ 11 lines elided ↑ open up ↑
 315  324  } zpool_status_t;
 316  325  
 317  326  extern zpool_status_t zpool_get_status(zpool_handle_t *, char **);
 318  327  extern zpool_status_t zpool_import_status(nvlist_t *, char **);
 319  328  extern void zpool_dump_ddt(const ddt_stat_t *dds, const ddt_histogram_t *ddh);
 320  329  
 321  330  /*
 322  331   * Statistics and configuration functions.
 323  332   */
 324  333  extern nvlist_t *zpool_get_config(zpool_handle_t *, nvlist_t **);
      334 +extern nvlist_t *zpool_get_features(zpool_handle_t *);
 325  335  extern int zpool_refresh_stats(zpool_handle_t *, boolean_t *);
 326  336  extern int zpool_get_errlog(zpool_handle_t *, nvlist_t **);
 327  337  
 328  338  /*
 329  339   * Import and export functions
 330  340   */
 331  341  extern int zpool_export(zpool_handle_t *, boolean_t);
 332  342  extern int zpool_export_force(zpool_handle_t *);
 333  343  extern int zpool_import(libzfs_handle_t *, nvlist_t *, const char *,
 334  344      char *altroot);
 335  345  extern int zpool_import_props(libzfs_handle_t *, nvlist_t *, const char *,
 336  346      nvlist_t *, int);
      347 +extern void zpool_print_unsup_feat(nvlist_t *config);
 337  348  
 338  349  /*
 339  350   * Search for pools to import
 340  351   */
 341  352  
 342  353  typedef struct importargs {
 343  354          char **path;            /* a list of paths to search            */
 344  355          int paths;              /* number of paths to search            */
 345  356          char *poolname;         /* name of a pool to find               */
 346  357          uint64_t guid;          /* guid of a pool to find               */
↓ open down ↓ 69 lines elided ↑ open up ↑
 416  427  extern int zfs_prop_get_numeric(zfs_handle_t *, zfs_prop_t, uint64_t *,
 417  428      zprop_source_t *, char *, size_t);
 418  429  extern int zfs_prop_get_userquota_int(zfs_handle_t *zhp, const char *propname,
 419  430      uint64_t *propvalue);
 420  431  extern int zfs_prop_get_userquota(zfs_handle_t *zhp, const char *propname,
 421  432      char *propbuf, int proplen, boolean_t literal);
 422  433  extern int zfs_prop_get_written_int(zfs_handle_t *zhp, const char *propname,
 423  434      uint64_t *propvalue);
 424  435  extern int zfs_prop_get_written(zfs_handle_t *zhp, const char *propname,
 425  436      char *propbuf, int proplen, boolean_t literal);
      437 +extern int zfs_prop_get_feature(zfs_handle_t *zhp, const char *propname,
      438 +    char *buf, size_t len);
 426  439  extern int zfs_get_snapused_int(zfs_handle_t *firstsnap, zfs_handle_t *lastsnap,
 427  440      uint64_t *usedp);
 428  441  extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t);
 429  442  extern int zfs_prop_inherit(zfs_handle_t *, const char *, boolean_t);
 430  443  extern const char *zfs_prop_values(zfs_prop_t);
 431  444  extern int zfs_prop_is_string(zfs_prop_t prop);
 432  445  extern nvlist_t *zfs_get_user_props(zfs_handle_t *);
 433  446  extern nvlist_t *zfs_get_recvd_props(zfs_handle_t *);
 434  447  extern nvlist_t *zfs_get_clones_nvl(zfs_handle_t *);
 435  448  
↓ open down ↓ 7 lines elided ↑ open up ↑
 443  456          size_t          pl_recvd_width;
 444  457          boolean_t       pl_fixed;
 445  458  } zprop_list_t;
 446  459  
 447  460  extern int zfs_expand_proplist(zfs_handle_t *, zprop_list_t **, boolean_t);
 448  461  extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *);
 449  462  
 450  463  #define ZFS_MOUNTPOINT_NONE     "none"
 451  464  #define ZFS_MOUNTPOINT_LEGACY   "legacy"
 452  465  
      466 +#define ZFS_FEATURE_DISABLED    "disabled"
      467 +#define ZFS_FEATURE_ENABLED     "enabled"
      468 +#define ZFS_FEATURE_ACTIVE      "active"
      469 +
      470 +#define ZFS_UNSUPPORTED_INACTIVE        "inactive"
      471 +#define ZFS_UNSUPPORTED_READONLY        "readonly"
      472 +
 453  473  /*
 454  474   * zpool property management
 455  475   */
 456  476  extern int zpool_expand_proplist(zpool_handle_t *, zprop_list_t **);
      477 +extern int zpool_prop_get_feature(zpool_handle_t *, const char *, char *,
      478 +    size_t);
 457  479  extern const char *zpool_prop_default_string(zpool_prop_t);
 458  480  extern uint64_t zpool_prop_default_numeric(zpool_prop_t);
 459  481  extern const char *zpool_prop_column_name(zpool_prop_t);
 460  482  extern boolean_t zpool_prop_align_right(zpool_prop_t);
 461  483  
 462  484  /*
 463  485   * Functions shared by zfs and zpool property management.
 464  486   */
 465  487  extern int zprop_iter(zprop_func func, void *cb, boolean_t show_all,
 466  488      boolean_t ordered, zfs_type_t type);
↓ open down ↓ 267 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX