4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2011 by Delphix. All rights reserved.
  25  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  26  */
  27 
  28 /* Portions Copyright 2010 Robert Milkowski */
  29 
  30 #ifndef _SYS_FS_ZFS_H
  31 #define _SYS_FS_ZFS_H
  32 
  33 #include <sys/time.h>
  34 
  35 #ifdef  __cplusplus
  36 extern "C" {
  37 #endif
  38 
  39 /*
  40  * Types and constants shared between userland and the kernel.
  41  */
  42 
  43 /*
 
 147 typedef enum {
 148         ZPOOL_PROP_NAME,
 149         ZPOOL_PROP_SIZE,
 150         ZPOOL_PROP_CAPACITY,
 151         ZPOOL_PROP_ALTROOT,
 152         ZPOOL_PROP_HEALTH,
 153         ZPOOL_PROP_GUID,
 154         ZPOOL_PROP_VERSION,
 155         ZPOOL_PROP_BOOTFS,
 156         ZPOOL_PROP_DELEGATION,
 157         ZPOOL_PROP_AUTOREPLACE,
 158         ZPOOL_PROP_CACHEFILE,
 159         ZPOOL_PROP_FAILUREMODE,
 160         ZPOOL_PROP_LISTSNAPS,
 161         ZPOOL_PROP_AUTOEXPAND,
 162         ZPOOL_PROP_DEDUPDITTO,
 163         ZPOOL_PROP_DEDUPRATIO,
 164         ZPOOL_PROP_FREE,
 165         ZPOOL_PROP_ALLOCATED,
 166         ZPOOL_PROP_READONLY,
 167         ZPOOL_NUM_PROPS
 168 } zpool_prop_t;
 169 
 170 #define ZPROP_CONT              -2
 171 #define ZPROP_INVAL             -1
 172 
 173 #define ZPROP_VALUE             "value"
 174 #define ZPROP_SOURCE            "source"
 175 
 176 typedef enum {
 177         ZPROP_SRC_NONE = 0x1,
 178         ZPROP_SRC_DEFAULT = 0x2,
 179         ZPROP_SRC_TEMPORARY = 0x4,
 180         ZPROP_SRC_LOCAL = 0x8,
 181         ZPROP_SRC_INHERITED = 0x10,
 182         ZPROP_SRC_RECEIVED = 0x20
 183 } zprop_source_t;
 184 
 185 #define ZPROP_SRC_ALL   0x3f
 186 
 187 #define ZPROP_SOURCE_VAL_RECVD  "$recvd"
 188 #define ZPROP_N_MORE_ERRORS     "N_MORE_ERRORS"
 189 /*
 
 474 #define ZPOOL_CONFIG_NPARITY            "nparity"
 475 #define ZPOOL_CONFIG_HOSTID             "hostid"
 476 #define ZPOOL_CONFIG_HOSTNAME           "hostname"
 477 #define ZPOOL_CONFIG_LOADED_TIME        "initial_load_time"
 478 #define ZPOOL_CONFIG_UNSPARE            "unspare"
 479 #define ZPOOL_CONFIG_PHYS_PATH          "phys_path"
 480 #define ZPOOL_CONFIG_IS_LOG             "is_log"
 481 #define ZPOOL_CONFIG_L2CACHE            "l2cache"
 482 #define ZPOOL_CONFIG_HOLE_ARRAY         "hole_array"
 483 #define ZPOOL_CONFIG_VDEV_CHILDREN      "vdev_children"
 484 #define ZPOOL_CONFIG_IS_HOLE            "is_hole"
 485 #define ZPOOL_CONFIG_DDT_HISTOGRAM      "ddt_histogram"
 486 #define ZPOOL_CONFIG_DDT_OBJ_STATS      "ddt_object_stats"
 487 #define ZPOOL_CONFIG_DDT_STATS          "ddt_stats"
 488 #define ZPOOL_CONFIG_SPLIT              "splitcfg"
 489 #define ZPOOL_CONFIG_ORIG_GUID          "orig_guid"
 490 #define ZPOOL_CONFIG_SPLIT_GUID         "split_guid"
 491 #define ZPOOL_CONFIG_SPLIT_LIST         "guid_list"
 492 #define ZPOOL_CONFIG_REMOVING           "removing"
 493 #define ZPOOL_CONFIG_RESILVERING        "resilvering"
 494 #define ZPOOL_CONFIG_SUSPENDED          "suspended"     /* not stored on disk */
 495 #define ZPOOL_CONFIG_TIMESTAMP          "timestamp"     /* not stored on disk */
 496 #define ZPOOL_CONFIG_BOOTFS             "bootfs"        /* not stored on disk */
 497 #define ZPOOL_CONFIG_MISSING_DEVICES    "missing_vdevs" /* not stored on disk */
 498 #define ZPOOL_CONFIG_LOAD_INFO          "load_info"     /* not stored on disk */
 499 /*
 500  * The persistent vdev state is stored as separate values rather than a single
 501  * 'vdev_state' entry.  This is because a device can be in multiple states, such
 502  * as offline and degraded.
 503  */
 504 #define ZPOOL_CONFIG_OFFLINE            "offline"
 505 #define ZPOOL_CONFIG_FAULTED            "faulted"
 506 #define ZPOOL_CONFIG_DEGRADED           "degraded"
 507 #define ZPOOL_CONFIG_REMOVED            "removed"
 508 #define ZPOOL_CONFIG_FRU                "fru"
 509 #define ZPOOL_CONFIG_AUX_STATE          "aux_state"
 510 
 511 /* Rewind policy parameters */
 512 #define ZPOOL_REWIND_POLICY             "rewind-policy"
 513 #define ZPOOL_REWIND_REQUEST            "rewind-request"
  
 | 
 
 
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  25  * Copyright (c) 2011 by Delphix. All rights reserved.
  26  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  27  */
  28 
  29 /* Portions Copyright 2010 Robert Milkowski */
  30 
  31 #ifndef _SYS_FS_ZFS_H
  32 #define _SYS_FS_ZFS_H
  33 
  34 #include <sys/time.h>
  35 
  36 #ifdef  __cplusplus
  37 extern "C" {
  38 #endif
  39 
  40 /*
  41  * Types and constants shared between userland and the kernel.
  42  */
  43 
  44 /*
 
 148 typedef enum {
 149         ZPOOL_PROP_NAME,
 150         ZPOOL_PROP_SIZE,
 151         ZPOOL_PROP_CAPACITY,
 152         ZPOOL_PROP_ALTROOT,
 153         ZPOOL_PROP_HEALTH,
 154         ZPOOL_PROP_GUID,
 155         ZPOOL_PROP_VERSION,
 156         ZPOOL_PROP_BOOTFS,
 157         ZPOOL_PROP_DELEGATION,
 158         ZPOOL_PROP_AUTOREPLACE,
 159         ZPOOL_PROP_CACHEFILE,
 160         ZPOOL_PROP_FAILUREMODE,
 161         ZPOOL_PROP_LISTSNAPS,
 162         ZPOOL_PROP_AUTOEXPAND,
 163         ZPOOL_PROP_DEDUPDITTO,
 164         ZPOOL_PROP_DEDUPRATIO,
 165         ZPOOL_PROP_FREE,
 166         ZPOOL_PROP_ALLOCATED,
 167         ZPOOL_PROP_READONLY,
 168         ZPOOL_PROP_COMMENT,
 169         ZPOOL_NUM_PROPS
 170 } zpool_prop_t;
 171 
 172 /* Small enough to not hog a whole line of printout in zpool(1M). */
 173 #define ZPROP_MAX_COMMENT       32
 174 
 175 #define ZPROP_CONT              -2
 176 #define ZPROP_INVAL             -1
 177 
 178 #define ZPROP_VALUE             "value"
 179 #define ZPROP_SOURCE            "source"
 180 
 181 typedef enum {
 182         ZPROP_SRC_NONE = 0x1,
 183         ZPROP_SRC_DEFAULT = 0x2,
 184         ZPROP_SRC_TEMPORARY = 0x4,
 185         ZPROP_SRC_LOCAL = 0x8,
 186         ZPROP_SRC_INHERITED = 0x10,
 187         ZPROP_SRC_RECEIVED = 0x20
 188 } zprop_source_t;
 189 
 190 #define ZPROP_SRC_ALL   0x3f
 191 
 192 #define ZPROP_SOURCE_VAL_RECVD  "$recvd"
 193 #define ZPROP_N_MORE_ERRORS     "N_MORE_ERRORS"
 194 /*
 
 479 #define ZPOOL_CONFIG_NPARITY            "nparity"
 480 #define ZPOOL_CONFIG_HOSTID             "hostid"
 481 #define ZPOOL_CONFIG_HOSTNAME           "hostname"
 482 #define ZPOOL_CONFIG_LOADED_TIME        "initial_load_time"
 483 #define ZPOOL_CONFIG_UNSPARE            "unspare"
 484 #define ZPOOL_CONFIG_PHYS_PATH          "phys_path"
 485 #define ZPOOL_CONFIG_IS_LOG             "is_log"
 486 #define ZPOOL_CONFIG_L2CACHE            "l2cache"
 487 #define ZPOOL_CONFIG_HOLE_ARRAY         "hole_array"
 488 #define ZPOOL_CONFIG_VDEV_CHILDREN      "vdev_children"
 489 #define ZPOOL_CONFIG_IS_HOLE            "is_hole"
 490 #define ZPOOL_CONFIG_DDT_HISTOGRAM      "ddt_histogram"
 491 #define ZPOOL_CONFIG_DDT_OBJ_STATS      "ddt_object_stats"
 492 #define ZPOOL_CONFIG_DDT_STATS          "ddt_stats"
 493 #define ZPOOL_CONFIG_SPLIT              "splitcfg"
 494 #define ZPOOL_CONFIG_ORIG_GUID          "orig_guid"
 495 #define ZPOOL_CONFIG_SPLIT_GUID         "split_guid"
 496 #define ZPOOL_CONFIG_SPLIT_LIST         "guid_list"
 497 #define ZPOOL_CONFIG_REMOVING           "removing"
 498 #define ZPOOL_CONFIG_RESILVERING        "resilvering"
 499 #define ZPOOL_CONFIG_COMMENT            "comment"
 500 #define ZPOOL_CONFIG_SUSPENDED          "suspended"     /* not stored on disk */
 501 #define ZPOOL_CONFIG_TIMESTAMP          "timestamp"     /* not stored on disk */
 502 #define ZPOOL_CONFIG_BOOTFS             "bootfs"        /* not stored on disk */
 503 #define ZPOOL_CONFIG_MISSING_DEVICES    "missing_vdevs" /* not stored on disk */
 504 #define ZPOOL_CONFIG_LOAD_INFO          "load_info"     /* not stored on disk */
 505 /*
 506  * The persistent vdev state is stored as separate values rather than a single
 507  * 'vdev_state' entry.  This is because a device can be in multiple states, such
 508  * as offline and degraded.
 509  */
 510 #define ZPOOL_CONFIG_OFFLINE            "offline"
 511 #define ZPOOL_CONFIG_FAULTED            "faulted"
 512 #define ZPOOL_CONFIG_DEGRADED           "degraded"
 513 #define ZPOOL_CONFIG_REMOVED            "removed"
 514 #define ZPOOL_CONFIG_FRU                "fru"
 515 #define ZPOOL_CONFIG_AUX_STATE          "aux_state"
 516 
 517 /* Rewind policy parameters */
 518 #define ZPOOL_REWIND_POLICY             "rewind-policy"
 519 #define ZPOOL_REWIND_REQUEST            "rewind-request"
  
 |