Print this page
usr/src/cmd/zpool/zpool_util.c
*** 20,30 ****
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2016 by Delphix. All rights reserved.
! * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
* Copyright 2017 Joyent, Inc.
* Copyright (c) 2017 Datto Inc.
*/
--- 20,31 ----
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2016 by Delphix. All rights reserved.
! * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
! * Copyright (c) 2013, Saso Kiselkov. All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
* Copyright 2017 Joyent, Inc.
* Copyright (c) 2017 Datto Inc.
*/
*** 50,60 ****
typedef enum {
ZFS_TYPE_FILESYSTEM = (1 << 0),
ZFS_TYPE_SNAPSHOT = (1 << 1),
ZFS_TYPE_VOLUME = (1 << 2),
ZFS_TYPE_POOL = (1 << 3),
! ZFS_TYPE_BOOKMARK = (1 << 4)
} zfs_type_t;
/*
* NB: lzc_dataset_type should be updated whenever a new objset type is added,
* if it represents a real type of a dataset that can be created from userland.
--- 51,64 ----
typedef enum {
ZFS_TYPE_FILESYSTEM = (1 << 0),
ZFS_TYPE_SNAPSHOT = (1 << 1),
ZFS_TYPE_VOLUME = (1 << 2),
ZFS_TYPE_POOL = (1 << 3),
! ZFS_TYPE_BOOKMARK = (1 << 4),
! ZFS_TYPE_VDEV = (1 << 5),
! ZFS_TYPE_COS = (1 << 6),
! ZFS_TYPE_AUTOSNAP = (1 << 7)
} zfs_type_t;
/*
* NB: lzc_dataset_type should be updated whenever a new objset type is added,
* if it represents a real type of a dataset that can be created from userland.
*** 68,78 ****
DMU_OST_ANY, /* Be careful! */
DMU_OST_NUMTYPES
} dmu_objset_type_t;
#define ZFS_TYPE_DATASET \
! (ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME | ZFS_TYPE_SNAPSHOT)
/*
* All of these include the terminating NUL byte.
*/
#define ZAP_MAXNAMELEN 256
--- 72,83 ----
DMU_OST_ANY, /* Be careful! */
DMU_OST_NUMTYPES
} dmu_objset_type_t;
#define ZFS_TYPE_DATASET \
! (ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME |\
! ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP)
/*
* All of these include the terminating NUL byte.
*/
#define ZAP_MAXNAMELEN 256
*** 85,96 ****
* the end of this list to ensure that external consumers are not affected
* by the change. If you make any changes to this list, be sure to update
* the property table in usr/src/common/zfs/zfs_prop.c.
*/
typedef enum {
! ZPROP_CONT = -2,
! ZPROP_INVAL = -1,
ZFS_PROP_TYPE = 0,
ZFS_PROP_CREATION,
ZFS_PROP_USED,
ZFS_PROP_AVAILABLE,
ZFS_PROP_REFERENCED,
--- 90,100 ----
* the end of this list to ensure that external consumers are not affected
* by the change. If you make any changes to this list, be sure to update
* the property table in usr/src/common/zfs/zfs_prop.c.
*/
typedef enum {
! ZFS_PROP_BAD = -1,
ZFS_PROP_TYPE = 0,
ZFS_PROP_CREATION,
ZFS_PROP_USED,
ZFS_PROP_AVAILABLE,
ZFS_PROP_REFERENCED,
*** 158,169 ****
ZFS_PROP_SNAPSHOT_LIMIT,
ZFS_PROP_FILESYSTEM_COUNT,
ZFS_PROP_SNAPSHOT_COUNT,
ZFS_PROP_REDUNDANT_METADATA,
ZFS_PROP_PREV_SNAP,
ZFS_PROP_RECEIVE_RESUME_TOKEN,
! ZFS_PROP_REMAPTXG, /* not exposed to the user */
ZFS_NUM_PROPS
} zfs_prop_t;
typedef enum {
ZFS_PROP_USERUSED,
--- 162,178 ----
ZFS_PROP_SNAPSHOT_LIMIT,
ZFS_PROP_FILESYSTEM_COUNT,
ZFS_PROP_SNAPSHOT_COUNT,
ZFS_PROP_REDUNDANT_METADATA,
ZFS_PROP_PREV_SNAP,
+ ZFS_PROP_LSTXG,
+ ZFS_PROP_ZPL_META_TO_METADEV,
+ ZFS_PROP_WBC_MODE,
ZFS_PROP_RECEIVE_RESUME_TOKEN,
! ZFS_PROP_SMARTCOMPRESSION,
! ZFS_PROP_RATE_LIMIT,
! ZFS_PROP_MODIFIED,
ZFS_NUM_PROPS
} zfs_prop_t;
typedef enum {
ZFS_PROP_USERUSED,
*** 178,190 ****
/*
* Pool properties are identified by these constants and must be added to the
* end of this list to ensure that external consumers are not affected
* by the change. If you make any changes to this list, be sure to update
* the property table in usr/src/common/zfs/zpool_prop.c.
*/
typedef enum {
- ZPOOL_PROP_INVAL = -1,
ZPOOL_PROP_NAME,
ZPOOL_PROP_SIZE,
ZPOOL_PROP_CAPACITY,
ZPOOL_PROP_ALTROOT,
ZPOOL_PROP_HEALTH,
--- 187,202 ----
/*
* Pool properties are identified by these constants and must be added to the
* end of this list to ensure that external consumers are not affected
* by the change. If you make any changes to this list, be sure to update
* the property table in usr/src/common/zfs/zpool_prop.c.
+ *
+ * NOTE: When either adding or changing a feature make sure
+ * to update the zfs-tests zpool_get configuration file
+ * at usr/src/test/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg
*/
typedef enum {
ZPOOL_PROP_NAME,
ZPOOL_PROP_SIZE,
ZPOOL_PROP_CAPACITY,
ZPOOL_PROP_ALTROOT,
ZPOOL_PROP_HEALTH,
*** 197,222 ****
--- 209,319 ----
ZPOOL_PROP_FAILUREMODE,
ZPOOL_PROP_LISTSNAPS,
ZPOOL_PROP_AUTOEXPAND,
ZPOOL_PROP_DEDUPDITTO,
ZPOOL_PROP_DEDUPRATIO,
+ ZPOOL_PROP_DDTCAPPED,
ZPOOL_PROP_FREE,
ZPOOL_PROP_ALLOCATED,
ZPOOL_PROP_READONLY,
ZPOOL_PROP_COMMENT,
ZPOOL_PROP_EXPANDSZ,
ZPOOL_PROP_FREEING,
ZPOOL_PROP_FRAGMENTATION,
ZPOOL_PROP_LEAKED,
ZPOOL_PROP_MAXBLOCKSIZE,
+ ZPOOL_PROP_ENABLESPECIAL,
+ ZPOOL_PROP_LOWATERMARK,
+ ZPOOL_PROP_HIWATERMARK,
+ ZPOOL_PROP_DEDUPMETA_DITTO,
+ ZPOOL_PROP_DDT_DESEGREGATION,
+ ZPOOL_PROP_META_PLACEMENT,
+ ZPOOL_PROP_DDT_META_TO_METADEV,
+ ZPOOL_PROP_ZFS_META_TO_METADEV,
+ ZPOOL_PROP_DEDUP_BEST_EFFORT,
+ ZPOOL_PROP_DEDUP_LO_BEST_EFFORT,
+ ZPOOL_PROP_DEDUP_HI_BEST_EFFORT,
+ ZPOOL_PROP_FORCETRIM,
+ ZPOOL_PROP_AUTOTRIM,
+ ZPOOL_PROP_SMALL_DATA_TO_METADEV,
+ ZPOOL_PROP_MINWATERMARK,
+ ZPOOL_PROP_SYNC_TO_SPECIAL,
ZPOOL_PROP_BOOTSIZE,
+ ZPOOL_PROP_SCRUB_PRIO,
+ ZPOOL_PROP_RESILVER_PRIO,
ZPOOL_NUM_PROPS
} zpool_prop_t;
+ /*
+ * Note: it is important to keep min/max active properties together in the
+ * same order as the corresponding zio_priority_t definitions as this order
+ * is relied upon when processing in loops. See vdev_impl.h for the set of
+ * macros that rely on this dependency.
+ * Also path must be the first entry in the enum as loops use it as a starting
+ * index.
+ */
+ typedef enum vdev_prop {
+ VDEV_PROP_PATH,
+ VDEV_PROP_FRU,
+ /* minactive props for queue classes */
+ VDEV_PROP_READ_MINACTIVE,
+ VDEV_PROP_AREAD_MINACTIVE,
+ VDEV_PROP_WRITE_MINACTIVE,
+ VDEV_PROP_AWRITE_MINACTIVE,
+ VDEV_PROP_RESILVER_MINACTIVE,
+ VDEV_PROP_SCRUB_MINACTIVE,
+ /* maxactive props for queue classes */
+ VDEV_PROP_READ_MAXACTIVE,
+ VDEV_PROP_AREAD_MAXACTIVE,
+ VDEV_PROP_WRITE_MAXACTIVE,
+ VDEV_PROP_AWRITE_MAXACTIVE,
+ VDEV_PROP_RESILVER_MAXACTIVE,
+ VDEV_PROP_SCRUB_MAXACTIVE,
+ VDEV_PROP_PREFERRED_READ,
+ VDEV_PROP_COS,
+ VDEV_PROP_SPAREGROUP,
+ VDEV_PROP_L2ADDDT,
+ VDEV_PROP_GUID,
+ VDEV_NUM_PROPS
+ } vdev_prop_t;
+
+ /*
+ * Note: it is important to keep min/max active properties together in the
+ * same order as the corresponding zio_priority_t definitions as this order
+ * is relied upon when processing in loops. See cos.h for the set of
+ * macros that rely on this dependency.
+ */
+ typedef enum cos_prop {
+ COS_PROP_GUID,
+ /* user-defined cos name */
+ COS_PROP_NAME,
+ /* IO tunables */
+ /* minactive props for queue classes */
+ COS_PROP_READ_MINACTIVE,
+ COS_PROP_AREAD_MINACTIVE,
+ COS_PROP_WRITE_MINACTIVE,
+ COS_PROP_AWRITE_MINACTIVE,
+ COS_PROP_RESILVER_MINACTIVE,
+ COS_PROP_SCRUB_MINACTIVE,
+ /* maxactive props for queue classes */
+ COS_PROP_READ_MAXACTIVE,
+ COS_PROP_AREAD_MAXACTIVE,
+ COS_PROP_WRITE_MAXACTIVE,
+ COS_PROP_AWRITE_MAXACTIVE,
+ COS_PROP_RESILVER_MAXACTIVE,
+ COS_PROP_SCRUB_MAXACTIVE,
+ /* preference for read in mirror configurations */
+ COS_PROP_PREFERRED_READ,
+ COS_NUM_PROPS
+ } cos_prop_t;
+
/* Small enough to not hog a whole line of printout in zpool(1M). */
#define ZPROP_MAX_COMMENT 32
+ #define ZPROP_CONT -2
+ #define ZPROP_INVAL -1
+
#define ZPROP_VALUE "value"
#define ZPROP_SOURCE "source"
typedef enum {
ZPROP_SRC_NONE = 0x1,
*** 291,300 ****
--- 388,422 ----
int zpool_prop_index_to_string(zpool_prop_t, uint64_t, const char **);
int zpool_prop_string_to_index(zpool_prop_t, const char *, uint64_t *);
uint64_t zpool_prop_random_value(zpool_prop_t, uint64_t seed);
/*
+ * Vdev property functions shared between libzfs and kernel.
+ */
+ vdev_prop_t vdev_name_to_prop(const char *);
+ const char *vdev_prop_to_name(vdev_prop_t);
+ const char *vdev_prop_default_string(vdev_prop_t);
+ uint64_t vdev_prop_default_numeric(vdev_prop_t);
+ boolean_t vdev_prop_readonly(vdev_prop_t);
+ int vdev_prop_index_to_string(vdev_prop_t, uint64_t, const char **);
+ int vdev_prop_string_to_index(vdev_prop_t, const char *, uint64_t *);
+ uint64_t vdev_prop_random_value(vdev_prop_t, uint64_t seed);
+
+ /*
+ * COS property functions shared between libzfs and kernel.
+ */
+ cos_prop_t cos_name_to_prop(const char *);
+ const char *cos_prop_to_name(cos_prop_t);
+ const char *cos_prop_default_string(cos_prop_t);
+ uint64_t cos_prop_default_numeric(cos_prop_t);
+ boolean_t cos_prop_readonly(cos_prop_t);
+ int cos_prop_index_to_string(cos_prop_t, uint64_t, const char **);
+ int cos_prop_string_to_index(cos_prop_t, const char *, uint64_t *);
+ uint64_t cos_prop_random_value(cos_prop_t, uint64_t seed);
+
+ #define MAXCOSNAMELEN (64)
+ /*
* Definitions for the Delegation.
*/
typedef enum {
ZFS_DELEG_WHO_UNKNOWN = 0,
ZFS_DELEG_USER = 'u',
*** 352,362 ****
} zfs_smb_acl_op_t;
typedef enum zfs_cache_type {
ZFS_CACHE_NONE = 0,
ZFS_CACHE_METADATA = 1,
! ZFS_CACHE_ALL = 2
} zfs_cache_type_t;
typedef enum {
ZFS_SYNC_STANDARD = 0,
ZFS_SYNC_ALWAYS = 1,
--- 474,485 ----
} zfs_smb_acl_op_t;
typedef enum zfs_cache_type {
ZFS_CACHE_NONE = 0,
ZFS_CACHE_METADATA = 1,
! ZFS_CACHE_ALL = 2,
! ZFS_CACHE_DATA = 3
} zfs_cache_type_t;
typedef enum {
ZFS_SYNC_STANDARD = 0,
ZFS_SYNC_ALWAYS = 1,
*** 366,375 ****
--- 489,504 ----
typedef enum {
ZFS_REDUNDANT_METADATA_ALL,
ZFS_REDUNDANT_METADATA_MOST
} zfs_redundant_metadata_type_t;
+ typedef enum {
+ ZFS_WBC_MODE_OFF,
+ ZFS_WBC_MODE_ON,
+ ZFS_WBC_MODE_OFF_DELAYED
+ } zfs_wbc_mode_t;
+
/*
* On-disk version number.
*/
#define SPA_VERSION_1 1ULL
#define SPA_VERSION_2 2ULL
*** 506,518 ****
uint64_t zrp_txg; /* specific txg to load */
} zpool_rewind_policy_t;
/*
* The following are configuration names used in the nvlist describing a pool's
! * configuration. New on-disk names should be prefixed with "<reverse-DNS>:"
! * (e.g. "org.open-zfs:") to avoid conflicting names being developed
! * independently.
*/
#define ZPOOL_CONFIG_VERSION "version"
#define ZPOOL_CONFIG_POOL_NAME "name"
#define ZPOOL_CONFIG_POOL_STATE "state"
#define ZPOOL_CONFIG_POOL_TXG "txg"
--- 635,645 ----
uint64_t zrp_txg; /* specific txg to load */
} zpool_rewind_policy_t;
/*
* The following are configuration names used in the nvlist describing a pool's
! * configuration.
*/
#define ZPOOL_CONFIG_VERSION "version"
#define ZPOOL_CONFIG_POOL_NAME "name"
#define ZPOOL_CONFIG_POOL_STATE "state"
#define ZPOOL_CONFIG_POOL_TXG "txg"
*** 522,545 ****
#define ZPOOL_CONFIG_VDEV_TREE "vdev_tree"
#define ZPOOL_CONFIG_TYPE "type"
#define ZPOOL_CONFIG_CHILDREN "children"
#define ZPOOL_CONFIG_ID "id"
#define ZPOOL_CONFIG_GUID "guid"
- #define ZPOOL_CONFIG_INDIRECT_OBJECT "com.delphix:indirect_object"
- #define ZPOOL_CONFIG_INDIRECT_BIRTHS "com.delphix:indirect_births"
- #define ZPOOL_CONFIG_PREV_INDIRECT_VDEV "com.delphix:prev_indirect_vdev"
#define ZPOOL_CONFIG_PATH "path"
#define ZPOOL_CONFIG_DEVID "devid"
#define ZPOOL_CONFIG_METASLAB_ARRAY "metaslab_array"
#define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift"
#define ZPOOL_CONFIG_ASHIFT "ashift"
#define ZPOOL_CONFIG_ASIZE "asize"
#define ZPOOL_CONFIG_DTL "DTL"
#define ZPOOL_CONFIG_SCAN_STATS "scan_stats" /* not stored on disk */
- #define ZPOOL_CONFIG_REMOVAL_STATS "removal_stats" /* not stored on disk */
#define ZPOOL_CONFIG_VDEV_STATS "vdev_stats" /* not stored on disk */
- #define ZPOOL_CONFIG_INDIRECT_SIZE "indirect_size" /* not stored on disk */
#define ZPOOL_CONFIG_WHOLE_DISK "whole_disk"
#define ZPOOL_CONFIG_ERRCOUNT "error_count"
#define ZPOOL_CONFIG_NOT_PRESENT "not_present"
#define ZPOOL_CONFIG_SPARES "spares"
#define ZPOOL_CONFIG_IS_SPARE "is_spare"
--- 649,667 ----
*** 548,558 ****
--- 670,682 ----
#define ZPOOL_CONFIG_HOSTNAME "hostname"
#define ZPOOL_CONFIG_LOADED_TIME "initial_load_time"
#define ZPOOL_CONFIG_UNSPARE "unspare"
#define ZPOOL_CONFIG_PHYS_PATH "phys_path"
#define ZPOOL_CONFIG_IS_LOG "is_log"
+ #define ZPOOL_CONFIG_IS_SPECIAL "is_special"
#define ZPOOL_CONFIG_L2CACHE "l2cache"
+ #define ZPOOL_CONFIG_L2CACHE_PERSISTENT "l2cache_persistent"
#define ZPOOL_CONFIG_HOLE_ARRAY "hole_array"
#define ZPOOL_CONFIG_VDEV_CHILDREN "vdev_children"
#define ZPOOL_CONFIG_IS_HOLE "is_hole"
#define ZPOOL_CONFIG_DDT_HISTOGRAM "ddt_histogram"
#define ZPOOL_CONFIG_DDT_OBJ_STATS "ddt_object_stats"
*** 560,569 ****
--- 684,694 ----
#define ZPOOL_CONFIG_SPLIT "splitcfg"
#define ZPOOL_CONFIG_ORIG_GUID "orig_guid"
#define ZPOOL_CONFIG_SPLIT_GUID "split_guid"
#define ZPOOL_CONFIG_SPLIT_LIST "guid_list"
#define ZPOOL_CONFIG_REMOVING "removing"
+ #define ZPOOL_CONFIG_RESILVERING "resilvering"
#define ZPOOL_CONFIG_RESILVER_TXG "resilver_txg"
#define ZPOOL_CONFIG_COMMENT "comment"
#define ZPOOL_CONFIG_SUSPENDED "suspended" /* not stored on disk */
#define ZPOOL_CONFIG_TIMESTAMP "timestamp" /* not stored on disk */
#define ZPOOL_CONFIG_BOOTFS "bootfs" /* not stored on disk */
*** 573,586 ****
#define ZPOOL_CONFIG_UNSUP_FEAT "unsup_feat" /* not stored on disk */
#define ZPOOL_CONFIG_ENABLED_FEAT "enabled_feat" /* not stored on disk */
#define ZPOOL_CONFIG_CAN_RDONLY "can_rdonly" /* not stored on disk */
#define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read"
#define ZPOOL_CONFIG_FEATURE_STATS "feature_stats" /* not stored on disk */
#define ZPOOL_CONFIG_VDEV_TOP_ZAP "com.delphix:vdev_zap_top"
#define ZPOOL_CONFIG_VDEV_LEAF_ZAP "com.delphix:vdev_zap_leaf"
#define ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS "com.delphix:has_per_vdev_zaps"
- #define ZPOOL_CONFIG_CACHEFILE "cachefile" /* not stored on disk */
/*
* The persistent vdev state is stored as separate values rather than a single
* 'vdev_state' entry. This is because a device can be in multiple states, such
* as offline and degraded.
*/
--- 698,711 ----
#define ZPOOL_CONFIG_UNSUP_FEAT "unsup_feat" /* not stored on disk */
#define ZPOOL_CONFIG_ENABLED_FEAT "enabled_feat" /* not stored on disk */
#define ZPOOL_CONFIG_CAN_RDONLY "can_rdonly" /* not stored on disk */
#define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read"
#define ZPOOL_CONFIG_FEATURE_STATS "feature_stats" /* not stored on disk */
+ #define ZPOOL_CONFIG_IS_SSD "is_ssd" /* not stored on disk */
#define ZPOOL_CONFIG_VDEV_TOP_ZAP "com.delphix:vdev_zap_top"
#define ZPOOL_CONFIG_VDEV_LEAF_ZAP "com.delphix:vdev_zap_leaf"
#define ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS "com.delphix:has_per_vdev_zaps"
/*
* The persistent vdev state is stored as separate values rather than a single
* 'vdev_state' entry. This is because a device can be in multiple states, such
* as offline and degraded.
*/
*** 588,597 ****
--- 713,726 ----
#define ZPOOL_CONFIG_FAULTED "faulted"
#define ZPOOL_CONFIG_DEGRADED "degraded"
#define ZPOOL_CONFIG_REMOVED "removed"
#define ZPOOL_CONFIG_FRU "fru"
#define ZPOOL_CONFIG_AUX_STATE "aux_state"
+ #define ZPOOL_CONFIG_TRIM_PROG "trim_prog"
+ #define ZPOOL_CONFIG_TRIM_RATE "trim_rate"
+ #define ZPOOL_CONFIG_TRIM_START_TIME "trim_start_time"
+ #define ZPOOL_CONFIG_TRIM_STOP_TIME "trim_stop_time"
/* Rewind policy parameters */
#define ZPOOL_REWIND_POLICY "rewind-policy"
#define ZPOOL_REWIND_REQUEST "rewind-request"
#define ZPOOL_REWIND_REQUEST_TXG "rewind-request-txg"
*** 612,629 ****
#define VDEV_TYPE_MISSING "missing"
#define VDEV_TYPE_HOLE "hole"
#define VDEV_TYPE_SPARE "spare"
#define VDEV_TYPE_LOG "log"
#define VDEV_TYPE_L2CACHE "l2cache"
! #define VDEV_TYPE_INDIRECT "indirect"
- /* VDEV_TOP_ZAP_* are used in top-level vdev ZAP objects. */
- #define VDEV_TOP_ZAP_INDIRECT_OBSOLETE_SM \
- "com.delphix:indirect_obsolete_sm"
- #define VDEV_TOP_ZAP_OBSOLETE_COUNTS_ARE_PRECISE \
- "com.delphix:obsolete_counts_are_precise"
-
/*
* This is needed in userland to report the minimum necessary device size.
*
* Note that the zfs test suite uses 64MB vdevs.
*/
--- 741,752 ----
#define VDEV_TYPE_MISSING "missing"
#define VDEV_TYPE_HOLE "hole"
#define VDEV_TYPE_SPARE "spare"
#define VDEV_TYPE_LOG "log"
#define VDEV_TYPE_L2CACHE "l2cache"
! #define VDEV_TYPE_SPECIAL "special"
/*
* This is needed in userland to report the minimum necessary device size.
*
* Note that the zfs test suite uses 64MB vdevs.
*/
*** 677,688 ****
VDEV_AUX_SPARED, /* hot spare used in another pool */
VDEV_AUX_ERR_EXCEEDED, /* too many errors */
VDEV_AUX_IO_FAILURE, /* experienced I/O failure */
VDEV_AUX_BAD_LOG, /* cannot read log chain(s) */
VDEV_AUX_EXTERNAL, /* external diagnosis */
! VDEV_AUX_SPLIT_POOL, /* vdev was split off into another pool */
! VDEV_AUX_CHILDREN_OFFLINE /* all children are offline */
} vdev_aux_t;
/*
* pool state. The following states are written to disk as part of the normal
* SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE. The remaining
--- 800,810 ----
VDEV_AUX_SPARED, /* hot spare used in another pool */
VDEV_AUX_ERR_EXCEEDED, /* too many errors */
VDEV_AUX_IO_FAILURE, /* experienced I/O failure */
VDEV_AUX_BAD_LOG, /* cannot read log chain(s) */
VDEV_AUX_EXTERNAL, /* external diagnosis */
! VDEV_AUX_SPLIT_POOL /* vdev was split off into another pool */
} vdev_aux_t;
/*
* pool state. The following states are written to disk as part of the normal
* SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE. The remaining
*** 705,727 ****
*/
typedef enum pool_scan_func {
POOL_SCAN_NONE,
POOL_SCAN_SCRUB,
POOL_SCAN_RESILVER,
POOL_SCAN_FUNCS
} pool_scan_func_t;
/*
* Used to control scrub pause and resume.
*/
typedef enum pool_scrub_cmd {
POOL_SCRUB_NORMAL = 0,
POOL_SCRUB_PAUSE,
POOL_SCRUB_FLAGS_END
} pool_scrub_cmd_t;
-
/*
* ZIO types. Needed to interpret vdev statistics below.
*/
typedef enum zio_type {
ZIO_TYPE_NULL = 0,
--- 827,858 ----
*/
typedef enum pool_scan_func {
POOL_SCAN_NONE,
POOL_SCAN_SCRUB,
POOL_SCAN_RESILVER,
+ POOL_SCAN_MOS,
+ POOL_SCAN_META,
POOL_SCAN_FUNCS
} pool_scan_func_t;
/*
+ * TRIM command configuration info.
+ */
+ typedef struct trim_cmd_info_s {
+ uint64_t tci_start; /* B_TRUE = start; B_FALSE = stop */
+ uint64_t tci_rate; /* requested TRIM rate in bytes/sec */
+ } trim_cmd_info_t;
+
+ /*
* Used to control scrub pause and resume.
*/
typedef enum pool_scrub_cmd {
POOL_SCRUB_NORMAL = 0,
POOL_SCRUB_PAUSE,
POOL_SCRUB_FLAGS_END
} pool_scrub_cmd_t;
/*
* ZIO types. Needed to interpret vdev statistics below.
*/
typedef enum zio_type {
ZIO_TYPE_NULL = 0,
*** 742,783 ****
uint64_t pss_func; /* pool_scan_func_t */
uint64_t pss_state; /* dsl_scan_state_t */
uint64_t pss_start_time; /* scan start time */
uint64_t pss_end_time; /* scan end time */
uint64_t pss_to_examine; /* total bytes to scan */
! uint64_t pss_examined; /* total examined bytes */
uint64_t pss_to_process; /* total bytes to process */
uint64_t pss_processed; /* total processed bytes */
uint64_t pss_errors; /* scan errors */
/* values not stored on disk */
uint64_t pss_pass_exam; /* examined bytes per scan pass */
uint64_t pss_pass_start; /* start time of a scan pass */
uint64_t pss_pass_scrub_pause; /* pause time of a scurb pass */
/* cumulative time scrub spent paused, needed for rate calculation */
uint64_t pss_pass_scrub_spent_paused;
} pool_scan_stat_t;
- typedef struct pool_removal_stat {
- uint64_t prs_state; /* dsl_scan_state_t */
- uint64_t prs_removing_vdev;
- uint64_t prs_start_time;
- uint64_t prs_end_time;
- uint64_t prs_to_copy; /* bytes that need to be copied */
- uint64_t prs_copied; /* bytes copied so far */
- /*
- * bytes of memory used for indirect mappings.
- * This includes all removed vdevs.
- */
- uint64_t prs_mapping_memory;
- } pool_removal_stat_t;
-
typedef enum dsl_scan_state {
DSS_NONE,
DSS_SCANNING,
DSS_FINISHED,
DSS_CANCELED,
DSS_NUM_STATES
} dsl_scan_state_t;
/*
--- 873,903 ----
uint64_t pss_func; /* pool_scan_func_t */
uint64_t pss_state; /* dsl_scan_state_t */
uint64_t pss_start_time; /* scan start time */
uint64_t pss_end_time; /* scan end time */
uint64_t pss_to_examine; /* total bytes to scan */
! uint64_t pss_examined; /* total bytes located by scanner */
! uint64_t pss_issued; /* total bytes checked by scanner */
uint64_t pss_to_process; /* total bytes to process */
uint64_t pss_processed; /* total processed bytes */
uint64_t pss_errors; /* scan errors */
/* values not stored on disk */
uint64_t pss_pass_exam; /* examined bytes per scan pass */
+ uint64_t pss_pass_work; /* issued bytes per scan pass */
uint64_t pss_pass_start; /* start time of a scan pass */
uint64_t pss_pass_scrub_pause; /* pause time of a scurb pass */
/* cumulative time scrub spent paused, needed for rate calculation */
uint64_t pss_pass_scrub_spent_paused;
} pool_scan_stat_t;
typedef enum dsl_scan_state {
DSS_NONE,
DSS_SCANNING,
DSS_FINISHED,
DSS_CANCELED,
+ DSS_FINISHING,
DSS_NUM_STATES
} dsl_scan_state_t;
/*
*** 800,809 ****
--- 920,931 ----
uint64_t vs_checksum_errors; /* checksum errors */
uint64_t vs_self_healed; /* self-healed bytes */
uint64_t vs_scan_removing; /* removing? */
uint64_t vs_scan_processed; /* scan processed bytes */
uint64_t vs_fragmentation; /* device fragmentation */
+ hrtime_t vs_latency[ZIO_TYPES]; /* moving average of latency */
+ hrtime_t vs_iotime[ZIO_TYPES]; /* time spent doing i/o */
} vdev_stat_t;
/*
* DDT statistics. Note: all fields should be 64-bit because this
* is passed between kernel and userland as an nvlist uint64 array.
*** 868,877 ****
--- 990,1000 ----
ZFS_IOC_VDEV_ADD,
ZFS_IOC_VDEV_REMOVE,
ZFS_IOC_VDEV_SET_STATE,
ZFS_IOC_VDEV_ATTACH,
ZFS_IOC_VDEV_DETACH,
+ ZFS_IOC_VDEV_SETL2ADDDT,
ZFS_IOC_VDEV_SETPATH,
ZFS_IOC_VDEV_SETFRU,
ZFS_IOC_OBJSET_STATS,
ZFS_IOC_OBJSET_ZPLPROPS,
ZFS_IOC_DATASET_LIST_NEXT,
*** 922,933 ****
ZFS_IOC_SEND_SPACE,
ZFS_IOC_CLONE,
ZFS_IOC_BOOKMARK,
ZFS_IOC_GET_BOOKMARKS,
ZFS_IOC_DESTROY_BOOKMARKS,
ZFS_IOC_CHANNEL_PROGRAM,
! ZFS_IOC_REMAP,
ZFS_IOC_LAST
} zfs_ioc_t;
/*
* Internal SPA load state. Used by FMA diagnosis engine.
--- 1045,1072 ----
ZFS_IOC_SEND_SPACE,
ZFS_IOC_CLONE,
ZFS_IOC_BOOKMARK,
ZFS_IOC_GET_BOOKMARKS,
ZFS_IOC_DESTROY_BOOKMARKS,
+ ZFS_IOC_VDEV_SET_PROPS,
+ ZFS_IOC_VDEV_GET_PROPS,
+ ZFS_IOC_COS_ALLOC,
+ ZFS_IOC_COS_FREE,
+ ZFS_IOC_COS_LIST,
+ ZFS_IOC_COS_SET_PROPS,
+ ZFS_IOC_COS_GET_PROPS,
+ ZFS_IOC_POOL_CONFIGS_NVL,
+ ZFS_IOC_POOL_STATS_NVL,
+ ZFS_IOC_OBJSET_STATS_NVL,
+ ZFS_IOC_DATASET_LIST_NEXT_NVL,
+ ZFS_IOC_SNAPSHOT_LIST_NEXT_NVL,
+ ZFS_IOC_POOL_GET_PROPS_NVL,
+ ZFS_IOC_CHECK_KRRP,
+ ZFS_IOC_BULK_LIST,
+ ZFS_IOC_POOL_TRIM,
ZFS_IOC_CHANNEL_PROGRAM,
! ZFS_IOC_SET_PROPS_MDS,
ZFS_IOC_LAST
} zfs_ioc_t;
/*
* Internal SPA load state. Used by FMA diagnosis engine.