Home | History | Annotate | Download | only in fs
      1    789    ahrens /*
      2    789    ahrens  * CDDL HEADER START
      3    789    ahrens  *
      4    789    ahrens  * The contents of this file are subject to the terms of the
      5   1485     lling  * Common Development and Distribution License (the "License").
      6   1485     lling  * You may not use this file except in compliance with the License.
      7    789    ahrens  *
      8    789    ahrens  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9    789    ahrens  * or http://www.opensolaris.org/os/licensing.
     10    789    ahrens  * See the License for the specific language governing permissions
     11    789    ahrens  * and limitations under the License.
     12    789    ahrens  *
     13    789    ahrens  * When distributing Covered Code, include this CDDL HEADER in each
     14    789    ahrens  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15    789    ahrens  * If applicable, add the following below this CDDL HEADER, with the
     16    789    ahrens  * fields enclosed by brackets "[]" replaced with your own identifying
     17    789    ahrens  * information: Portions Copyright [yyyy] [name of copyright owner]
     18    789    ahrens  *
     19    789    ahrens  * CDDL HEADER END
     20    789    ahrens  */
     21  10105      adam 
     22    789    ahrens /*
     23   8845       amw  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     24    789    ahrens  * Use is subject to license terms.
     25    789    ahrens  */
     26    789    ahrens 
     27    789    ahrens #ifndef	_SYS_FS_ZFS_H
     28    789    ahrens #define	_SYS_FS_ZFS_H
     29  10242     chris 
     30  10242     chris #include <sys/time.h>
     31    789    ahrens 
     32    789    ahrens #ifdef	__cplusplus
     33    789    ahrens extern "C" {
     34    789    ahrens #endif
     35    789    ahrens 
     36    789    ahrens /*
     37    789    ahrens  * Types and constants shared between userland and the kernel.
     38    789    ahrens  */
     39    789    ahrens 
     40    789    ahrens /*
     41    789    ahrens  * Each dataset can be one of the following types.  These constants can be
     42    789    ahrens  * combined into masks that can be passed to various functions.
     43    789    ahrens  */
     44    789    ahrens typedef enum {
     45    789    ahrens 	ZFS_TYPE_FILESYSTEM	= 0x1,
     46    789    ahrens 	ZFS_TYPE_SNAPSHOT	= 0x2,
     47   3912     lling 	ZFS_TYPE_VOLUME		= 0x4,
     48   3912     lling 	ZFS_TYPE_POOL		= 0x8
     49    789    ahrens } zfs_type_t;
     50    789    ahrens 
     51   5094     lling #define	ZFS_TYPE_DATASET	\
     52    789    ahrens 	(ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME | ZFS_TYPE_SNAPSHOT)
     53   9643      Eric 
     54   9643      Eric #define	ZAP_MAXNAMELEN 256
     55   9643      Eric #define	ZAP_MAXVALUELEN (1024 * 8)
     56   9643      Eric #define	ZAP_OLDMAXVALUELEN 1024
     57    789    ahrens 
     58    789    ahrens /*
     59   5094     lling  * Dataset properties are identified by these constants and must be added to
     60   5094     lling  * the end of this list to ensure that external consumers are not affected
     61   5094     lling  * by the change. If you make any changes to this list, be sure to update
     62   3654   gw25295  * the property table in usr/src/common/zfs/zfs_prop.c.
     63    789    ahrens  */
     64    789    ahrens typedef enum {
     65    789    ahrens 	ZFS_PROP_TYPE,
     66    789    ahrens 	ZFS_PROP_CREATION,
     67    789    ahrens 	ZFS_PROP_USED,
     68    789    ahrens 	ZFS_PROP_AVAILABLE,
     69    789    ahrens 	ZFS_PROP_REFERENCED,
     70    789    ahrens 	ZFS_PROP_COMPRESSRATIO,
     71    789    ahrens 	ZFS_PROP_MOUNTED,
     72    789    ahrens 	ZFS_PROP_ORIGIN,
     73    789    ahrens 	ZFS_PROP_QUOTA,
     74    789    ahrens 	ZFS_PROP_RESERVATION,
     75    789    ahrens 	ZFS_PROP_VOLSIZE,
     76    789    ahrens 	ZFS_PROP_VOLBLOCKSIZE,
     77    789    ahrens 	ZFS_PROP_RECORDSIZE,
     78    789    ahrens 	ZFS_PROP_MOUNTPOINT,
     79    789    ahrens 	ZFS_PROP_SHARENFS,
     80    789    ahrens 	ZFS_PROP_CHECKSUM,
     81    789    ahrens 	ZFS_PROP_COMPRESSION,
     82    789    ahrens 	ZFS_PROP_ATIME,
     83    789    ahrens 	ZFS_PROP_DEVICES,
     84    789    ahrens 	ZFS_PROP_EXEC,
     85    789    ahrens 	ZFS_PROP_SETUID,
     86    789    ahrens 	ZFS_PROP_READONLY,
     87    789    ahrens 	ZFS_PROP_ZONED,
     88    789    ahrens 	ZFS_PROP_SNAPDIR,
     89    789    ahrens 	ZFS_PROP_ACLMODE,
     90    789    ahrens 	ZFS_PROP_ACLINHERIT,
     91   3654   gw25295 	ZFS_PROP_CREATETXG,		/* not exposed to the user */
     92   3654   gw25295 	ZFS_PROP_NAME,			/* not exposed to the user */
     93   2676  eschrock 	ZFS_PROP_CANMOUNT,
     94   3654   gw25295 	ZFS_PROP_SHAREISCSI,
     95   3654   gw25295 	ZFS_PROP_ISCSIOPTIONS,		/* not exposed to the user */
     96   3234  ck153898 	ZFS_PROP_XATTR,
     97   3835    ahrens 	ZFS_PROP_NUMCLONES,		/* not exposed to the user */
     98   3912     lling 	ZFS_PROP_COPIES,
     99   4577    ahrens 	ZFS_PROP_VERSION,
    100   5331       amw 	ZFS_PROP_UTF8ONLY,
    101   5331       amw 	ZFS_PROP_NORMALIZE,
    102   5331       amw 	ZFS_PROP_CASE,
    103   5331       amw 	ZFS_PROP_VSCAN,
    104   5331       amw 	ZFS_PROP_NBMAND,
    105   5331       amw 	ZFS_PROP_SHARESMB,
    106   5378  ck153898 	ZFS_PROP_REFQUOTA,
    107   5378  ck153898 	ZFS_PROP_REFRESERVATION,
    108   6643  eschrock 	ZFS_PROP_GUID,
    109   7237  ek110237 	ZFS_PROP_PRIMARYCACHE,
    110   7237  ek110237 	ZFS_PROP_SECONDARYCACHE,
    111   7390   Matthew 	ZFS_PROP_USEDSNAP,
    112   7390   Matthew 	ZFS_PROP_USEDDS,
    113   7390   Matthew 	ZFS_PROP_USEDCHILD,
    114   7390   Matthew 	ZFS_PROP_USEDREFRESERV,
    115   9396   Matthew 	ZFS_PROP_USERACCOUNTING,	/* not exposed to the user */
    116   9643      Eric 	ZFS_PROP_STMF_SHAREINFO,	/* not exposed to the user */
    117  10242     chris 	ZFS_PROP_DEFER_DESTROY,
    118  10242     chris 	ZFS_PROP_USERREFS,
    119  10310      Neil 	ZFS_PROP_LOGBIAS,
    120  10575      Eric 	ZFS_PROP_UNIQUE,		/* not exposed to the user */
    121  10575      Eric 	ZFS_PROP_OBJSETID,		/* not exposed to the user */
    122  10922      Jeff 	ZFS_PROP_DEDUP,
    123  10972       Ric 	ZFS_PROP_MLSLABEL,
    124   4787    ahrens 	ZFS_NUM_PROPS
    125    789    ahrens } zfs_prop_t;
    126   9396   Matthew 
    127   9396   Matthew typedef enum {
    128   9396   Matthew 	ZFS_PROP_USERUSED,
    129   9396   Matthew 	ZFS_PROP_USERQUOTA,
    130   9396   Matthew 	ZFS_PROP_GROUPUSED,
    131   9396   Matthew 	ZFS_PROP_GROUPQUOTA,
    132   9396   Matthew 	ZFS_NUM_USERQUOTA_PROPS
    133   9396   Matthew } zfs_userquota_prop_t;
    134   9396   Matthew 
    135   9396   Matthew extern const char *zfs_userquota_prop_prefixes[ZFS_NUM_USERQUOTA_PROPS];
    136   3912     lling 
    137   5094     lling /*
    138   5094     lling  * Pool properties are identified by these constants and must be added to the
    139   7294    perrin  * end of this list to ensure that external consumers are not affected
    140   5094     lling  * by the change. If you make any changes to this list, be sure to update
    141   5094     lling  * the property table in usr/src/common/zfs/zpool_prop.c.
    142   5094     lling  */
    143   5094     lling typedef enum {
    144   5094     lling 	ZPOOL_PROP_NAME,
    145   5094     lling 	ZPOOL_PROP_SIZE,
    146   5094     lling 	ZPOOL_PROP_CAPACITY,
    147   5094     lling 	ZPOOL_PROP_ALTROOT,
    148   5094     lling 	ZPOOL_PROP_HEALTH,
    149   5094     lling 	ZPOOL_PROP_GUID,
    150   5094     lling 	ZPOOL_PROP_VERSION,
    151   5094     lling 	ZPOOL_PROP_BOOTFS,
    152   5094     lling 	ZPOOL_PROP_DELEGATION,
    153   5094     lling 	ZPOOL_PROP_AUTOREPLACE,
    154   5363  eschrock 	ZPOOL_PROP_CACHEFILE,
    155   5329   gw25295 	ZPOOL_PROP_FAILUREMODE,
    156   7538   Richard 	ZPOOL_PROP_LISTSNAPS,
    157   9816    George 	ZPOOL_PROP_AUTOEXPAND,
    158  10922      Jeff 	ZPOOL_PROP_DEDUPDITTO,
    159  10922      Jeff 	ZPOOL_PROP_DEDUPRATIO,
    160  10956    George 	ZPOOL_PROP_FREE,
    161  10956    George 	ZPOOL_PROP_ALLOCATED,
    162   5094     lling 	ZPOOL_NUM_PROPS
    163   5094     lling } zpool_prop_t;
    164   4451  eschrock 
    165   5094     lling #define	ZPROP_CONT		-2
    166   5094     lling #define	ZPROP_INVAL		-1
    167    789    ahrens 
    168   5094     lling #define	ZPROP_VALUE		"value"
    169   5094     lling #define	ZPROP_SOURCE		"source"
    170   3912     lling 
    171   3912     lling typedef enum {
    172   5094     lling 	ZPROP_SRC_NONE = 0x1,
    173   5094     lling 	ZPROP_SRC_DEFAULT = 0x2,
    174   5094     lling 	ZPROP_SRC_TEMPORARY = 0x4,
    175   5094     lling 	ZPROP_SRC_LOCAL = 0x8,
    176  11022       Tom 	ZPROP_SRC_INHERITED = 0x10,
    177  11022       Tom 	ZPROP_SRC_RECEIVED = 0x20
    178   5094     lling } zprop_source_t;
    179   3912     lling 
    180  11022       Tom #define	ZPROP_SRC_ALL	0x3f
    181  11022       Tom 
    182  11022       Tom #define	ZPROP_SOURCE_VAL_RECVD	"$recvd"
    183  11022       Tom #define	ZPROP_N_MORE_ERRORS	"N_MORE_ERRORS"
    184  11022       Tom /*
    185  11022       Tom  * Dataset flag implemented as a special entry in the props zap object
    186  11022       Tom  * indicating that the dataset has received properties on or after
    187  11022       Tom  * SPA_VERSION_RECVD_PROPS. The first such receive blows away local properties
    188  11022       Tom  * just as it did in earlier versions, and thereafter, local properties are
    189  11022       Tom  * preserved.
    190  11022       Tom  */
    191  11022       Tom #define	ZPROP_HAS_RECVD		"$hasrecvd"
    192  11022       Tom 
    193  11022       Tom typedef enum {
    194  11022       Tom 	ZPROP_ERR_NOCLEAR = 0x1, /* failure to clear existing props */
    195  11022       Tom 	ZPROP_ERR_NORESTORE = 0x2 /* failure to restore props on error */
    196  11022       Tom } zprop_errflags_t;
    197   1356  eschrock 
    198   5094     lling typedef int (*zprop_func)(int, void *);
    199   7184      timh 
    200   7184      timh /*
    201   7184      timh  * Properties to be set on the root file system of a new pool
    202   7184      timh  * are stuffed into their own nvlist, which is then included in
    203   7184      timh  * the properties nvlist with the pool properties.
    204   7184      timh  */
    205   7184      timh #define	ZPOOL_ROOTFS_PROPS	"root-props-nvl"
    206   5094     lling 
    207   5094     lling /*
    208   5094     lling  * Dataset property functions shared between libzfs and kernel.
    209   5094     lling  */
    210   5094     lling const char *zfs_prop_default_string(zfs_prop_t);
    211   5094     lling uint64_t zfs_prop_default_numeric(zfs_prop_t);
    212   5094     lling boolean_t zfs_prop_readonly(zfs_prop_t);
    213   5094     lling boolean_t zfs_prop_inheritable(zfs_prop_t);
    214   5331       amw boolean_t zfs_prop_setonce(zfs_prop_t);
    215   5094     lling const char *zfs_prop_to_name(zfs_prop_t);
    216   5094     lling zfs_prop_t zfs_name_to_prop(const char *);
    217   5094     lling boolean_t zfs_prop_user(const char *);
    218  11022       Tom boolean_t zfs_prop_userquota(const char *);
    219   5094     lling int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **);
    220   5094     lling int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *);
    221  10922      Jeff uint64_t zfs_prop_random_value(zfs_prop_t, uint64_t seed);
    222   6690   gw25295 boolean_t zfs_prop_valid_for_type(int, zfs_type_t);
    223   5094     lling 
    224   5094     lling /*
    225   5094     lling  * Pool property functions shared between libzfs and kernel.
    226   5094     lling  */
    227   5094     lling zpool_prop_t zpool_name_to_prop(const char *);
    228   5094     lling const char *zpool_prop_to_name(zpool_prop_t);
    229   5094     lling const char *zpool_prop_default_string(zpool_prop_t);
    230   5094     lling uint64_t zpool_prop_default_numeric(zpool_prop_t);
    231   5094     lling boolean_t zpool_prop_readonly(zpool_prop_t);
    232   5094     lling int zpool_prop_index_to_string(zpool_prop_t, uint64_t, const char **);
    233   5094     lling int zpool_prop_string_to_index(zpool_prop_t, const char *, uint64_t *);
    234  10922      Jeff uint64_t zpool_prop_random_value(zpool_prop_t, uint64_t seed);
    235   5094     lling 
    236   5094     lling /*
    237   5094     lling  * Definitions for the Delegation.
    238   5094     lling  */
    239   4543     marks typedef enum {
    240   4543     marks 	ZFS_DELEG_WHO_UNKNOWN = 0,
    241   4543     marks 	ZFS_DELEG_USER = 'u',
    242   4543     marks 	ZFS_DELEG_USER_SETS = 'U',
    243   4543     marks 	ZFS_DELEG_GROUP = 'g',
    244   4543     marks 	ZFS_DELEG_GROUP_SETS = 'G',
    245   4543     marks 	ZFS_DELEG_EVERYONE = 'e',
    246   4543     marks 	ZFS_DELEG_EVERYONE_SETS = 'E',
    247   4543     marks 	ZFS_DELEG_CREATE = 'c',
    248   4543     marks 	ZFS_DELEG_CREATE_SETS = 'C',
    249   4543     marks 	ZFS_DELEG_NAMED_SET = 's',
    250   4543     marks 	ZFS_DELEG_NAMED_SET_SETS = 'S'
    251   4543     marks } zfs_deleg_who_type_t;
    252   4543     marks 
    253   4543     marks typedef enum {
    254   4543     marks 	ZFS_DELEG_NONE = 0,
    255   4543     marks 	ZFS_DELEG_PERM_LOCAL = 1,
    256   4543     marks 	ZFS_DELEG_PERM_DESCENDENT = 2,
    257   4543     marks 	ZFS_DELEG_PERM_LOCALDESCENDENT = 3,
    258   4543     marks 	ZFS_DELEG_PERM_CREATE = 4
    259   4543     marks } zfs_deleg_inherit_t;
    260   4543     marks 
    261   4543     marks #define	ZFS_DELEG_PERM_UID	"uid"
    262   4543     marks #define	ZFS_DELEG_PERM_GID	"gid"
    263   4543     marks #define	ZFS_DELEG_PERM_GROUPS	"groups"
    264  10972       Ric 
    265  10972       Ric #define	ZFS_MLSLABEL_DEFAULT	"none"
    266   6168   hs24103 
    267   8845       amw #define	ZFS_SMB_ACL_SRC		"src"
    268   8845       amw #define	ZFS_SMB_ACL_TARGET	"target"
    269   8845       amw 
    270   6168   hs24103 typedef enum {
    271   6168   hs24103 	ZFS_CANMOUNT_OFF = 0,
    272   6168   hs24103 	ZFS_CANMOUNT_ON = 1,
    273   6168   hs24103 	ZFS_CANMOUNT_NOAUTO = 2
    274   6168   hs24103 } zfs_canmount_type_t;
    275  10310      Neil 
    276  10310      Neil typedef enum {
    277  10310      Neil 	ZFS_LOGBIAS_LATENCY = 0,
    278  10310      Neil 	ZFS_LOGBIAS_THROUGHPUT = 1
    279  10310      Neil } zfs_logbias_op_t;
    280   2082  eschrock 
    281   5331       amw typedef enum zfs_share_op {
    282   5331       amw 	ZFS_SHARE_NFS = 0,
    283   5331       amw 	ZFS_UNSHARE_NFS = 1,
    284   5331       amw 	ZFS_SHARE_SMB = 2,
    285   5331       amw 	ZFS_UNSHARE_SMB = 3
    286   5331       amw } zfs_share_op_t;
    287   8845       amw 
    288   8845       amw typedef enum zfs_smb_acl_op {
    289   8845       amw 	ZFS_SMB_ACL_ADD,
    290   8845       amw 	ZFS_SMB_ACL_REMOVE,
    291   8845       amw 	ZFS_SMB_ACL_RENAME,
    292   8845       amw 	ZFS_SMB_ACL_PURGE
    293   8845       amw } zfs_smb_acl_op_t;
    294   7237  ek110237 
    295   7237  ek110237 typedef enum zfs_cache_type {
    296   7237  ek110237 	ZFS_CACHE_NONE = 0,
    297   7237  ek110237 	ZFS_CACHE_METADATA = 1,
    298   7237  ek110237 	ZFS_CACHE_ALL = 2
    299   7237  ek110237 } zfs_cache_type_t;
    300   7237  ek110237 
    301   5331       amw 
    302    789    ahrens /*
    303   2082  eschrock  * On-disk version number.
    304   1760  eschrock  */
    305   4577    ahrens #define	SPA_VERSION_1			1ULL
    306   4577    ahrens #define	SPA_VERSION_2			2ULL
    307   4577    ahrens #define	SPA_VERSION_3			3ULL
    308   4577    ahrens #define	SPA_VERSION_4			4ULL
    309   4577    ahrens #define	SPA_VERSION_5			5ULL
    310   4577    ahrens #define	SPA_VERSION_6			6ULL
    311   4577    ahrens #define	SPA_VERSION_7			7ULL
    312   4577    ahrens #define	SPA_VERSION_8			8ULL
    313   5331       amw #define	SPA_VERSION_9			9ULL
    314   5450   brendan #define	SPA_VERSION_10			10ULL
    315   7046    ahrens #define	SPA_VERSION_11			11ULL
    316   7265    ahrens #define	SPA_VERSION_12			12ULL
    317   7390   Matthew #define	SPA_VERSION_13			13ULL
    318   8053      Mark #define	SPA_VERSION_14			14ULL
    319   9396   Matthew #define	SPA_VERSION_15			15ULL
    320   9643      Eric #define	SPA_VERSION_16			16ULL
    321  10105      adam #define	SPA_VERSION_17			17ULL
    322  10242     chris #define	SPA_VERSION_18			18ULL
    323  10594    George #define	SPA_VERSION_19			19ULL
    324  10922      Jeff #define	SPA_VERSION_20			20ULL
    325  10922      Jeff #define	SPA_VERSION_21			21ULL
    326  11022       Tom #define	SPA_VERSION_22			22ULL
    327   3912     lling /*
    328   6423   gw25295  * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk
    329   9643      Eric  * format change. Go to usr/src/grub/grub-0.97/stage2/{zfs-include/, fsys_zfs*},
    330   9396   Matthew  * and do the appropriate changes.  Also bump the version number in
    331   9396   Matthew  * usr/src/grub/capability.
    332   3912     lling  */
    333  11022       Tom #define	SPA_VERSION			SPA_VERSION_22
    334  11022       Tom #define	SPA_VERSION_STRING		"22"
    335   1775     billm 
    336   1775     billm /*
    337   4577    ahrens  * Symbolic names for the changes that caused a SPA_VERSION switch.
    338   1775     billm  * Used in the code when checking for presence or absence of a feature.
    339   1775     billm  * Feel free to define multiple symbolic names for each version if there
    340   1775     billm  * were multiple changes to on-disk structures during that version.
    341   1775     billm  *
    342   4577    ahrens  * NOTE: When checking the current SPA_VERSION in your code, be sure
    343   1775     billm  *       to use spa_version() since it reports the version of the
    344   1775     billm  *       last synced uberblock.  Checking the in-flight version can
    345   1775     billm  *       be dangerous in some cases.
    346   1775     billm  */
    347   4577    ahrens #define	SPA_VERSION_INITIAL		SPA_VERSION_1
    348   4577    ahrens #define	SPA_VERSION_DITTO_BLOCKS	SPA_VERSION_2
    349   4577    ahrens #define	SPA_VERSION_SPARES		SPA_VERSION_3
    350  10105      adam #define	SPA_VERSION_RAIDZ2		SPA_VERSION_3
    351   4577    ahrens #define	SPA_VERSION_BPLIST_ACCOUNT	SPA_VERSION_3
    352   4577    ahrens #define	SPA_VERSION_RAIDZ_DEFLATE	SPA_VERSION_3
    353   4577    ahrens #define	SPA_VERSION_DNODE_BYTES		SPA_VERSION_3
    354   4577    ahrens #define	SPA_VERSION_ZPOOL_HISTORY	SPA_VERSION_4
    355   4577    ahrens #define	SPA_VERSION_GZIP_COMPRESSION	SPA_VERSION_5
    356   4577    ahrens #define	SPA_VERSION_BOOTFS		SPA_VERSION_6
    357   5094     lling #define	SPA_VERSION_SLOGS		SPA_VERSION_7
    358   5094     lling #define	SPA_VERSION_DELEGATED_PERMS	SPA_VERSION_8
    359   5331       amw #define	SPA_VERSION_FUID		SPA_VERSION_9
    360   5378  ck153898 #define	SPA_VERSION_REFRESERVATION	SPA_VERSION_9
    361   5378  ck153898 #define	SPA_VERSION_REFQUOTA		SPA_VERSION_9
    362   5378  ck153898 #define	SPA_VERSION_UNIQUE_ACCURATE	SPA_VERSION_9
    363   5450   brendan #define	SPA_VERSION_L2CACHE		SPA_VERSION_10
    364   7046    ahrens #define	SPA_VERSION_NEXT_CLONES		SPA_VERSION_11
    365   7046    ahrens #define	SPA_VERSION_ORIGIN		SPA_VERSION_11
    366   7046    ahrens #define	SPA_VERSION_DSL_SCRUB		SPA_VERSION_11
    367   7265    ahrens #define	SPA_VERSION_SNAP_PROPS		SPA_VERSION_12
    368   7390   Matthew #define	SPA_VERSION_USED_BREAKDOWN	SPA_VERSION_13
    369   8053      Mark #define	SPA_VERSION_PASSTHROUGH_X	SPA_VERSION_14
    370   9396   Matthew #define	SPA_VERSION_USERSPACE		SPA_VERSION_15
    371   9643      Eric #define	SPA_VERSION_STMF_PROP		SPA_VERSION_16
    372  10105      adam #define	SPA_VERSION_RAIDZ3		SPA_VERSION_17
    373  10242     chris #define	SPA_VERSION_USERREFS		SPA_VERSION_18
    374  10594    George #define	SPA_VERSION_HOLES		SPA_VERSION_19
    375  10922      Jeff #define	SPA_VERSION_ZLE_COMPRESSION	SPA_VERSION_20
    376  10922      Jeff #define	SPA_VERSION_DEDUP		SPA_VERSION_21
    377  11022       Tom #define	SPA_VERSION_RECVD_PROPS		SPA_VERSION_22
    378   4577    ahrens 
    379   4577    ahrens /*
    380   4577    ahrens  * ZPL version - rev'd whenever an incompatible on-disk format change
    381   4577    ahrens  * occurs.  This is independent of SPA/DMU/ZAP versioning.  You must
    382   4577    ahrens  * also update the version_table[] and help message in zfs_prop.c.
    383   4577    ahrens  *
    384   4577    ahrens  * When changing, be sure to teach GRUB how to read the new format!
    385   9643      Eric  * See usr/src/grub/grub-0.97/stage2/{zfs-include/,fsys_zfs*}
    386   4577    ahrens  */
    387   4577    ahrens #define	ZPL_VERSION_1			1ULL
    388   4577    ahrens #define	ZPL_VERSION_2			2ULL
    389   5331       amw #define	ZPL_VERSION_3			3ULL
    390   9396   Matthew #define	ZPL_VERSION_4			4ULL
    391   9396   Matthew #define	ZPL_VERSION			ZPL_VERSION_4
    392   9396   Matthew #define	ZPL_VERSION_STRING		"4"
    393   4577    ahrens 
    394   4577    ahrens #define	ZPL_VERSION_INITIAL		ZPL_VERSION_1
    395   4577    ahrens #define	ZPL_VERSION_DIRENT_TYPE		ZPL_VERSION_2
    396   5331       amw #define	ZPL_VERSION_FUID		ZPL_VERSION_3
    397   5498      timh #define	ZPL_VERSION_NORMALIZATION	ZPL_VERSION_3
    398   5331       amw #define	ZPL_VERSION_SYSATTR		ZPL_VERSION_3
    399   9396   Matthew #define	ZPL_VERSION_USERSPACE		ZPL_VERSION_4
    400   1760  eschrock 
    401  10921       Tim /* Rewind request information */
    402  10921       Tim #define	ZPOOL_NO_REWIND		0
    403  10921       Tim #define	ZPOOL_TRY_REWIND	1 /* Search for best txg, but do not rewind */
    404  10921       Tim #define	ZPOOL_DO_REWIND		2 /* Rewind to best txg w/in deferred frees */
    405  10921       Tim #define	ZPOOL_EXTREME_REWIND	4 /* Allow extreme measures to find best txg */
    406  10921       Tim #define	ZPOOL_REWIND_MASK	7 /* All the possible policy bits */
    407  10921       Tim 
    408  10921       Tim typedef struct zpool_rewind_policy {
    409  10921       Tim 	uint32_t	zrp_request;	/* rewind behavior requested */
    410  10921       Tim 	uint32_t	zrp_maxmeta;	/* max acceptable meta-data errors */
    411  10921       Tim 	uint32_t	zrp_maxdata;	/* max acceptable data errors */
    412  10921       Tim 	uint64_t	zrp_txg;	/* specific txg to load */
    413  10921       Tim } zpool_rewind_policy_t;
    414  10921       Tim 
    415   1760  eschrock /*
    416    789    ahrens  * The following are configuration names used in the nvlist describing a pool's
    417    789    ahrens  * configuration.
    418    789    ahrens  */
    419    789    ahrens #define	ZPOOL_CONFIG_VERSION		"version"
    420    789    ahrens #define	ZPOOL_CONFIG_POOL_NAME		"name"
    421    789    ahrens #define	ZPOOL_CONFIG_POOL_STATE		"state"
    422    789    ahrens #define	ZPOOL_CONFIG_POOL_TXG		"txg"
    423    789    ahrens #define	ZPOOL_CONFIG_POOL_GUID		"pool_guid"
    424    789    ahrens #define	ZPOOL_CONFIG_CREATE_TXG		"create_txg"
    425    789    ahrens #define	ZPOOL_CONFIG_TOP_GUID		"top_guid"
    426    789    ahrens #define	ZPOOL_CONFIG_VDEV_TREE		"vdev_tree"
    427    789    ahrens #define	ZPOOL_CONFIG_TYPE		"type"
    428    789    ahrens #define	ZPOOL_CONFIG_CHILDREN		"children"
    429    789    ahrens #define	ZPOOL_CONFIG_ID			"id"
    430    789    ahrens #define	ZPOOL_CONFIG_GUID		"guid"
    431    789    ahrens #define	ZPOOL_CONFIG_PATH		"path"
    432    789    ahrens #define	ZPOOL_CONFIG_DEVID		"devid"
    433    789    ahrens #define	ZPOOL_CONFIG_METASLAB_ARRAY	"metaslab_array"
    434    789    ahrens #define	ZPOOL_CONFIG_METASLAB_SHIFT	"metaslab_shift"
    435    789    ahrens #define	ZPOOL_CONFIG_ASHIFT		"ashift"
    436    789    ahrens #define	ZPOOL_CONFIG_ASIZE		"asize"
    437    789    ahrens #define	ZPOOL_CONFIG_DTL		"DTL"
    438    789    ahrens #define	ZPOOL_CONFIG_STATS		"stats"
    439   1171  eschrock #define	ZPOOL_CONFIG_WHOLE_DISK		"whole_disk"
    440   1544  eschrock #define	ZPOOL_CONFIG_ERRCOUNT		"error_count"
    441   1544  eschrock #define	ZPOOL_CONFIG_NOT_PRESENT	"not_present"
    442   2082  eschrock #define	ZPOOL_CONFIG_SPARES		"spares"
    443   2082  eschrock #define	ZPOOL_CONFIG_IS_SPARE		"is_spare"
    444   2082  eschrock #define	ZPOOL_CONFIG_NPARITY		"nparity"
    445   3975  ek110237 #define	ZPOOL_CONFIG_HOSTID		"hostid"
    446   3975  ek110237 #define	ZPOOL_CONFIG_HOSTNAME		"hostname"
    447   4451  eschrock #define	ZPOOL_CONFIG_UNSPARE		"unspare"
    448   4451  eschrock #define	ZPOOL_CONFIG_PHYS_PATH		"phys_path"
    449   4527    perrin #define	ZPOOL_CONFIG_IS_LOG		"is_log"
    450   5450   brendan #define	ZPOOL_CONFIG_L2CACHE		"l2cache"
    451  10594    George #define	ZPOOL_CONFIG_HOLE_ARRAY		"hole_array"
    452  10594    George #define	ZPOOL_CONFIG_VDEV_CHILDREN	"vdev_children"
    453  10594    George #define	ZPOOL_CONFIG_IS_HOLE		"is_hole"
    454  11149    George #define	ZPOOL_CONFIG_DDT_HISTOGRAM	"ddt_histogram"
    455  11149    George #define	ZPOOL_CONFIG_DDT_OBJ_STATS	"ddt_object_stats"
    456  11149    George #define	ZPOOL_CONFIG_DDT_STATS		"ddt_stats"
    457   7754      Jeff #define	ZPOOL_CONFIG_SUSPENDED		"suspended"	/* not stored on disk */
    458   6423   gw25295 #define	ZPOOL_CONFIG_TIMESTAMP		"timestamp"	/* not stored on disk */
    459   6423   gw25295 #define	ZPOOL_CONFIG_BOOTFS		"bootfs"	/* not stored on disk */
    460   4451  eschrock /*
    461   4451  eschrock  * The persistent vdev state is stored as separate values rather than a single
    462   4451  eschrock  * 'vdev_state' entry.  This is because a device can be in multiple states, such
    463   4451  eschrock  * as offline and degraded.
    464   4451  eschrock  */
    465   4451  eschrock #define	ZPOOL_CONFIG_OFFLINE		"offline"
    466   4451  eschrock #define	ZPOOL_CONFIG_FAULTED		"faulted"
    467   4451  eschrock #define	ZPOOL_CONFIG_DEGRADED		"degraded"
    468   4451  eschrock #define	ZPOOL_CONFIG_REMOVED		"removed"
    469   9425      Eric #define	ZPOOL_CONFIG_FRU		"fru"
    470  10817      Eric #define	ZPOOL_CONFIG_AUX_STATE		"aux_state"
    471  10921       Tim 
    472  10921       Tim /* Rewind policy parameters */
    473  10921       Tim #define	ZPOOL_REWIND_POLICY		"rewind-policy"
    474  10921       Tim #define	ZPOOL_REWIND_REQUEST		"rewind-request"
    475  10921       Tim #define	ZPOOL_REWIND_REQUEST_TXG	"rewind-request-txg"
    476  10921       Tim #define	ZPOOL_REWIND_META_THRESH	"rewind-meta-thresh"
    477  10921       Tim #define	ZPOOL_REWIND_DATA_THRESH	"rewind-data-thresh"
    478  10921       Tim 
    479  10921       Tim /* Rewind data discovered */
    480  10921       Tim #define	ZPOOL_CONFIG_LOAD_TIME		"rewind_txg_ts"
    481  10921       Tim #define	ZPOOL_CONFIG_LOAD_DATA_ERRORS	"verify_data_errors"
    482  10921       Tim #define	ZPOOL_CONFIG_REWIND_TIME	"seconds_of_rewind"
    483    789    ahrens 
    484    789    ahrens #define	VDEV_TYPE_ROOT			"root"
    485    789    ahrens #define	VDEV_TYPE_MIRROR		"mirror"
    486    789    ahrens #define	VDEV_TYPE_REPLACING		"replacing"
    487    789    ahrens #define	VDEV_TYPE_RAIDZ			"raidz"
    488    789    ahrens #define	VDEV_TYPE_DISK			"disk"
    489    789    ahrens #define	VDEV_TYPE_FILE			"file"
    490    789    ahrens #define	VDEV_TYPE_MISSING		"missing"
    491  10594    George #define	VDEV_TYPE_HOLE			"hole"
    492   2082  eschrock #define	VDEV_TYPE_SPARE			"spare"
    493   4527    perrin #define	VDEV_TYPE_LOG			"log"
    494   5450   brendan #define	VDEV_TYPE_L2CACHE		"l2cache"
    495    789    ahrens 
    496    789    ahrens /*
    497    789    ahrens  * This is needed in userland to report the minimum necessary device size.
    498    789    ahrens  */
    499    789    ahrens #define	SPA_MINDEVSIZE		(64ULL << 20)
    500    789    ahrens 
    501    789    ahrens /*
    502    789    ahrens  * The location of the pool configuration repository, shared between kernel and
    503    789    ahrens  * userland.
    504    789    ahrens  */
    505   6643  eschrock #define	ZPOOL_CACHE		"/etc/zfs/zpool.cache"
    506    789    ahrens 
    507    789    ahrens /*
    508    789    ahrens  * vdev states are ordered from least to most healthy.
    509    789    ahrens  * A vdev that's CANT_OPEN or below is considered unusable.
    510    789    ahrens  */
    511    789    ahrens typedef enum vdev_state {
    512    789    ahrens 	VDEV_STATE_UNKNOWN = 0,	/* Uninitialized vdev			*/
    513    789    ahrens 	VDEV_STATE_CLOSED,	/* Not currently open			*/
    514    789    ahrens 	VDEV_STATE_OFFLINE,	/* Not allowed to open			*/
    515   4451  eschrock 	VDEV_STATE_REMOVED,	/* Explicitly removed from system	*/
    516    789    ahrens 	VDEV_STATE_CANT_OPEN,	/* Tried to open, but failed		*/
    517   4451  eschrock 	VDEV_STATE_FAULTED,	/* External request to fault device	*/
    518    789    ahrens 	VDEV_STATE_DEGRADED,	/* Replicated vdev with unhealthy kids	*/
    519    789    ahrens 	VDEV_STATE_HEALTHY	/* Presumed good			*/
    520    789    ahrens } vdev_state_t;
    521   4451  eschrock 
    522   4451  eschrock #define	VDEV_STATE_ONLINE	VDEV_STATE_HEALTHY
    523    789    ahrens 
    524    789    ahrens /*
    525    789    ahrens  * vdev aux states.  When a vdev is in the CANT_OPEN state, the aux field
    526    789    ahrens  * of the vdev stats structure uses these constants to distinguish why.
    527    789    ahrens  */
    528    789    ahrens typedef enum vdev_aux {
    529    789    ahrens 	VDEV_AUX_NONE,		/* no error				*/
    530    789    ahrens 	VDEV_AUX_OPEN_FAILED,	/* ldi_open_*() or vn_open() failed	*/
    531    789    ahrens 	VDEV_AUX_CORRUPT_DATA,	/* bad label or disk contents		*/
    532    789    ahrens 	VDEV_AUX_NO_REPLICAS,	/* insufficient number of replicas	*/
    533    789    ahrens 	VDEV_AUX_BAD_GUID_SUM,	/* vdev guid sum doesn't match		*/
    534    789    ahrens 	VDEV_AUX_TOO_SMALL,	/* vdev size is too small		*/
    535   1760  eschrock 	VDEV_AUX_BAD_LABEL,	/* the label is OK but invalid		*/
    536   1760  eschrock 	VDEV_AUX_VERSION_NEWER,	/* on-disk version is too new		*/
    537   2082  eschrock 	VDEV_AUX_VERSION_OLDER,	/* on-disk version is too old		*/
    538   4451  eschrock 	VDEV_AUX_SPARED,	/* hot spare used in another pool	*/
    539   6523  ek110237 	VDEV_AUX_ERR_EXCEEDED,	/* too many errors			*/
    540   7294    perrin 	VDEV_AUX_IO_FAILURE,	/* experienced I/O failure		*/
    541  10817      Eric 	VDEV_AUX_BAD_LOG,	/* cannot read log chain(s)		*/
    542  10817      Eric 	VDEV_AUX_EXTERNAL	/* external diagnosis			*/
    543    789    ahrens } vdev_aux_t;
    544    789    ahrens 
    545    789    ahrens /*
    546   1352  eschrock  * pool state.  The following states are written to disk as part of the normal
    547   5450   brendan  * SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE.  The remaining
    548   5450   brendan  * states are software abstractions used at various levels to communicate
    549   5450   brendan  * pool state.
    550    789    ahrens  */
    551    789    ahrens typedef enum pool_state {
    552    789    ahrens 	POOL_STATE_ACTIVE = 0,		/* In active use		*/
    553    789    ahrens 	POOL_STATE_EXPORTED,		/* Explicitly exported		*/
    554    789    ahrens 	POOL_STATE_DESTROYED,		/* Explicitly destroyed		*/
    555   2082  eschrock 	POOL_STATE_SPARE,		/* Reserved for hot spare use	*/
    556   5450   brendan 	POOL_STATE_L2CACHE,		/* Level 2 ARC device		*/
    557    789    ahrens 	POOL_STATE_UNINITIALIZED,	/* Internal spa_t state		*/
    558   1352  eschrock 	POOL_STATE_UNAVAIL,		/* Internal libzfs state	*/
    559   1352  eschrock 	POOL_STATE_POTENTIALLY_ACTIVE	/* Internal libzfs state	*/
    560    789    ahrens } pool_state_t;
    561    789    ahrens 
    562    789    ahrens /*
    563    789    ahrens  * Scrub types.
    564    789    ahrens  */
    565    789    ahrens typedef enum pool_scrub_type {
    566    789    ahrens 	POOL_SCRUB_NONE,
    567    789    ahrens 	POOL_SCRUB_RESILVER,
    568    789    ahrens 	POOL_SCRUB_EVERYTHING,
    569    789    ahrens 	POOL_SCRUB_TYPES
    570    789    ahrens } pool_scrub_type_t;
    571    789    ahrens 
    572    789    ahrens /*
    573    789    ahrens  * ZIO types.  Needed to interpret vdev statistics below.
    574    789    ahrens  */
    575    789    ahrens typedef enum zio_type {
    576    789    ahrens 	ZIO_TYPE_NULL = 0,
    577    789    ahrens 	ZIO_TYPE_READ,
    578    789    ahrens 	ZIO_TYPE_WRITE,
    579    789    ahrens 	ZIO_TYPE_FREE,
    580    789    ahrens 	ZIO_TYPE_CLAIM,
    581    789    ahrens 	ZIO_TYPE_IOCTL,
    582    789    ahrens 	ZIO_TYPES
    583    789    ahrens } zio_type_t;
    584    789    ahrens 
    585    789    ahrens /*
    586    789    ahrens  * Vdev statistics.  Note: all fields should be 64-bit because this
    587    789    ahrens  * is passed between kernel and userland as an nvlist uint64 array.
    588    789    ahrens  */
    589    789    ahrens typedef struct vdev_stat {
    590    789    ahrens 	hrtime_t	vs_timestamp;		/* time since vdev load	*/
    591    789    ahrens 	uint64_t	vs_state;		/* vdev state		*/
    592    789    ahrens 	uint64_t	vs_aux;			/* see vdev_aux_t	*/
    593    789    ahrens 	uint64_t	vs_alloc;		/* space allocated	*/
    594    789    ahrens 	uint64_t	vs_space;		/* total capacity	*/
    595   2082  eschrock 	uint64_t	vs_dspace;		/* deflated capacity	*/
    596   1175     lling 	uint64_t	vs_rsize;		/* replaceable dev size */
    597    789    ahrens 	uint64_t	vs_ops[ZIO_TYPES];	/* operation count	*/
    598    789    ahrens 	uint64_t	vs_bytes[ZIO_TYPES];	/* bytes read/written	*/
    599    789    ahrens 	uint64_t	vs_read_errors;		/* read errors		*/
    600    789    ahrens 	uint64_t	vs_write_errors;	/* write errors		*/
    601    789    ahrens 	uint64_t	vs_checksum_errors;	/* checksum errors	*/
    602    789    ahrens 	uint64_t	vs_self_healed;		/* self-healed bytes	*/
    603    789    ahrens 	uint64_t	vs_scrub_type;		/* pool_scrub_type_t	*/
    604    789    ahrens 	uint64_t	vs_scrub_complete;	/* completed?		*/
    605    789    ahrens 	uint64_t	vs_scrub_examined;	/* bytes examined; top	*/
    606    789    ahrens 	uint64_t	vs_scrub_repaired;	/* bytes repaired; leaf	*/
    607    789    ahrens 	uint64_t	vs_scrub_errors;	/* errors during scrub	*/
    608    789    ahrens 	uint64_t	vs_scrub_start;		/* UTC scrub start time	*/
    609    789    ahrens 	uint64_t	vs_scrub_end;		/* UTC scrub end time	*/
    610    789    ahrens } vdev_stat_t;
    611    789    ahrens 
    612  11149    George /*
    613  11149    George  * DDT statistics.  Note: all fields should be 64-bit because this
    614  11149    George  * is passed between kernel and userland as an nvlist uint64 array.
    615  11149    George  */
    616  11149    George typedef struct ddt_object {
    617  11149    George 	uint64_t	ddo_count;	/* number of elments in ddt 	*/
    618  11149    George 	uint64_t	ddo_dspace;	/* size of ddt on disk		*/
    619  11149    George 	uint64_t	ddo_mspace;	/* size of ddt in-core		*/
    620  11149    George } ddt_object_t;
    621  11149    George 
    622  11149    George typedef struct ddt_stat {
    623  11149    George 	uint64_t	dds_blocks;	/* blocks			*/
    624  11149    George 	uint64_t	dds_lsize;	/* logical size			*/
    625  11149    George 	uint64_t	dds_psize;	/* physical size		*/
    626  11149    George 	uint64_t	dds_dsize;	/* deflated allocated size	*/
    627  11149    George 	uint64_t	dds_ref_blocks;	/* referenced blocks		*/
    628  11149    George 	uint64_t	dds_ref_lsize;	/* referenced lsize * refcnt	*/
    629  11149    George 	uint64_t	dds_ref_psize;	/* referenced psize * refcnt	*/
    630  11149    George 	uint64_t	dds_ref_dsize;	/* referenced dsize * refcnt	*/
    631  11149    George } ddt_stat_t;
    632  11149    George 
    633  11149    George typedef struct ddt_histogram {
    634  11149    George 	ddt_stat_t	ddh_stat[64];	/* power-of-two histogram buckets */
    635  11149    George } ddt_histogram_t;
    636  11149    George 
    637   6423   gw25295 #define	ZVOL_DRIVER	"zvol"
    638    789    ahrens #define	ZFS_DRIVER	"zfs"
    639    789    ahrens #define	ZFS_DEV		"/dev/zfs"
    640    789    ahrens 
    641  10588      Eric /* general zvol path */
    642  10588      Eric #define	ZVOL_DIR		"/dev/zvol"
    643  10588      Eric /* expansion */
    644   9816    George #define	ZVOL_PSEUDO_DEV		"/devices/pseudo/zfs@0:"
    645  10588      Eric /* for dump and swap */
    646  10588      Eric #define	ZVOL_FULL_DEV_DIR	ZVOL_DIR "/dsk/"
    647  10588      Eric #define	ZVOL_FULL_RDEV_DIR	ZVOL_DIR "/rdsk/"
    648    789    ahrens 
    649    789    ahrens #define	ZVOL_PROP_NAME		"name"
    650    789    ahrens 
    651    789    ahrens /*
    652    789    ahrens  * /dev/zfs ioctl numbers.
    653    789    ahrens  */
    654    789    ahrens #define	ZFS_IOC		('Z' << 8)
    655    789    ahrens 
    656    789    ahrens typedef enum zfs_ioc {
    657    789    ahrens 	ZFS_IOC_POOL_CREATE = ZFS_IOC,
    658    789    ahrens 	ZFS_IOC_POOL_DESTROY,
    659    789    ahrens 	ZFS_IOC_POOL_IMPORT,
    660    789    ahrens 	ZFS_IOC_POOL_EXPORT,
    661    789    ahrens 	ZFS_IOC_POOL_CONFIGS,
    662    789    ahrens 	ZFS_IOC_POOL_STATS,
    663    789    ahrens 	ZFS_IOC_POOL_TRYIMPORT,
    664    789    ahrens 	ZFS_IOC_POOL_SCRUB,
    665    789    ahrens 	ZFS_IOC_POOL_FREEZE,
    666   1760  eschrock 	ZFS_IOC_POOL_UPGRADE,
    667   2926  ek110237 	ZFS_IOC_POOL_GET_HISTORY,
    668    789    ahrens 	ZFS_IOC_VDEV_ADD,
    669    789    ahrens 	ZFS_IOC_VDEV_REMOVE,
    670   4451  eschrock 	ZFS_IOC_VDEV_SET_STATE,
    671    789    ahrens 	ZFS_IOC_VDEV_ATTACH,
    672    789    ahrens 	ZFS_IOC_VDEV_DETACH,
    673   1354  eschrock 	ZFS_IOC_VDEV_SETPATH,
    674   9425      Eric 	ZFS_IOC_VDEV_SETFRU,
    675    789    ahrens 	ZFS_IOC_OBJSET_STATS,
    676   5498      timh 	ZFS_IOC_OBJSET_ZPLPROPS,
    677    789    ahrens 	ZFS_IOC_DATASET_LIST_NEXT,
    678    789    ahrens 	ZFS_IOC_SNAPSHOT_LIST_NEXT,
    679    789    ahrens 	ZFS_IOC_SET_PROP,
    680    789    ahrens 	ZFS_IOC_CREATE,
    681    789    ahrens 	ZFS_IOC_DESTROY,
    682    789    ahrens 	ZFS_IOC_ROLLBACK,
    683    789    ahrens 	ZFS_IOC_RENAME,
    684   5367    ahrens 	ZFS_IOC_RECV,
    685   5367    ahrens 	ZFS_IOC_SEND,
    686   1544  eschrock 	ZFS_IOC_INJECT_FAULT,
    687   1544  eschrock 	ZFS_IOC_CLEAR_FAULT,
    688   1544  eschrock 	ZFS_IOC_INJECT_LIST_NEXT,
    689   1544  eschrock 	ZFS_IOC_ERROR_LOG,
    690   1544  eschrock 	ZFS_IOC_CLEAR,
    691   2199    ahrens 	ZFS_IOC_PROMOTE,
    692   2199    ahrens 	ZFS_IOC_DESTROY_SNAPS,
    693   3444  ek110237 	ZFS_IOC_SNAPSHOT,
    694   3444  ek110237 	ZFS_IOC_DSOBJ_TO_DSNAME,
    695   3912     lling 	ZFS_IOC_OBJ_TO_PATH,
    696   3912     lling 	ZFS_IOC_POOL_SET_PROPS,
    697   4543     marks 	ZFS_IOC_POOL_GET_PROPS,
    698   4543     marks 	ZFS_IOC_SET_FSACL,
    699   4543     marks 	ZFS_IOC_GET_FSACL,
    700   4543     marks 	ZFS_IOC_ISCSI_PERM_CHECK,
    701   4849    ahrens 	ZFS_IOC_SHARE,
    702   8845       amw 	ZFS_IOC_INHERIT_PROP,
    703   9396   Matthew 	ZFS_IOC_SMB_ACL,
    704   9396   Matthew 	ZFS_IOC_USERSPACE_ONE,
    705   9396   Matthew 	ZFS_IOC_USERSPACE_MANY,
    706  10242     chris 	ZFS_IOC_USERSPACE_UPGRADE,
    707  10242     chris 	ZFS_IOC_HOLD,
    708  10242     chris 	ZFS_IOC_RELEASE,
    709  11022       Tom 	ZFS_IOC_GET_HOLDS,
    710  11022       Tom 	ZFS_IOC_OBJSET_RECVD_PROPS
    711    789    ahrens } zfs_ioc_t;
    712   1544  eschrock 
    713   1544  eschrock /*
    714   1544  eschrock  * Internal SPA load state.  Used by FMA diagnosis engine.
    715   1544  eschrock  */
    716   1544  eschrock typedef enum {
    717  11149    George 	SPA_LOAD_NONE,		/* no load in progress	*/
    718  11149    George 	SPA_LOAD_OPEN,		/* normal open		*/
    719  11149    George 	SPA_LOAD_IMPORT,	/* import in progress	*/
    720  10921       Tim 	SPA_LOAD_TRYIMPORT,	/* tryimport in progress */
    721  11149    George 	SPA_LOAD_RECOVER,	/* recovery requested	*/
    722  11149    George 	SPA_LOAD_ERROR		/* load failed		*/
    723   1544  eschrock } spa_load_state_t;
    724    789    ahrens 
    725   2676  eschrock /*
    726   2676  eschrock  * Bookmark name values.
    727   2676  eschrock  */
    728   3444  ek110237 #define	ZPOOL_ERR_LIST		"error list"
    729   2676  eschrock #define	ZPOOL_ERR_DATASET	"dataset"
    730   2676  eschrock #define	ZPOOL_ERR_OBJECT	"object"
    731   2676  eschrock 
    732   2926  ek110237 #define	HIS_MAX_RECORD_LEN	(MAXPATHLEN + MAXPATHLEN + 1)
    733   2926  ek110237 
    734   2926  ek110237 /*
    735   2926  ek110237  * The following are names used in the nvlist describing
    736   2926  ek110237  * the pool's history log.
    737   2926  ek110237  */
    738   2926  ek110237 #define	ZPOOL_HIST_RECORD	"history record"
    739   2926  ek110237 #define	ZPOOL_HIST_TIME		"history time"
    740   2926  ek110237 #define	ZPOOL_HIST_CMD		"history command"
    741   4543     marks #define	ZPOOL_HIST_WHO		"history who"
    742   4543     marks #define	ZPOOL_HIST_ZONE		"history zone"
    743   4543     marks #define	ZPOOL_HIST_HOST		"history hostname"
    744   4543     marks #define	ZPOOL_HIST_TXG		"history txg"
    745   4543     marks #define	ZPOOL_HIST_INT_EVENT	"history internal event"
    746   4543     marks #define	ZPOOL_HIST_INT_STR	"history internal str"
    747   2926  ek110237 
    748   4451  eschrock /*
    749   4451  eschrock  * Flags for ZFS_IOC_VDEV_SET_STATE
    750   4451  eschrock  */
    751   4451  eschrock #define	ZFS_ONLINE_CHECKREMOVE	0x1
    752   4451  eschrock #define	ZFS_ONLINE_UNSPARE	0x2
    753   4451  eschrock #define	ZFS_ONLINE_FORCEFAULT	0x4
    754   9816    George #define	ZFS_ONLINE_EXPAND	0x8
    755   4451  eschrock #define	ZFS_OFFLINE_TEMPORARY	0x1
    756   4451  eschrock 
    757   4451  eschrock /*
    758   4451  eschrock  * Sysevent payload members.  ZFS will generate the following sysevents with the
    759   4451  eschrock  * given payloads:
    760   4451  eschrock  *
    761   4451  eschrock  *	ESC_ZFS_RESILVER_START
    762   4451  eschrock  *	ESC_ZFS_RESILVER_END
    763   4451  eschrock  *	ESC_ZFS_POOL_DESTROY
    764   4451  eschrock  *
    765   4451  eschrock  *		ZFS_EV_POOL_NAME	DATA_TYPE_STRING
    766   4451  eschrock  *		ZFS_EV_POOL_GUID	DATA_TYPE_UINT64
    767   4451  eschrock  *
    768   4451  eschrock  *	ESC_ZFS_VDEV_REMOVE
    769   4451  eschrock  *	ESC_ZFS_VDEV_CLEAR
    770   4451  eschrock  *	ESC_ZFS_VDEV_CHECK
    771   4451  eschrock  *
    772   4451  eschrock  *		ZFS_EV_POOL_NAME	DATA_TYPE_STRING
    773   4451  eschrock  *		ZFS_EV_POOL_GUID	DATA_TYPE_UINT64
    774   4451  eschrock  *		ZFS_EV_VDEV_PATH	DATA_TYPE_STRING	(optional)
    775   4451  eschrock  *		ZFS_EV_VDEV_GUID	DATA_TYPE_UINT64
    776   4451  eschrock  */
    777   4451  eschrock #define	ZFS_EV_POOL_NAME	"pool_name"
    778   4451  eschrock #define	ZFS_EV_POOL_GUID	"pool_guid"
    779   4451  eschrock #define	ZFS_EV_VDEV_PATH	"vdev_path"
    780   4451  eschrock #define	ZFS_EV_VDEV_GUID	"vdev_guid"
    781   4451  eschrock 
    782   7046    ahrens /*
    783   7046    ahrens  * Note: This is encoded on-disk, so new events must be added to the
    784   7046    ahrens  * end, and unused events can not be removed.  Be sure to edit
    785  10685    George  * libzfs_pool.c: hist_event_table[].
    786   7046    ahrens  */
    787   4543     marks typedef enum history_internal_events {
    788   4543     marks 	LOG_NO_EVENT = 0,
    789   4543     marks 	LOG_POOL_CREATE,
    790   4543     marks 	LOG_POOL_VDEV_ADD,
    791   4543     marks 	LOG_POOL_REMOVE,
    792   4543     marks 	LOG_POOL_DESTROY,
    793   4543     marks 	LOG_POOL_EXPORT,
    794   4543     marks 	LOG_POOL_IMPORT,
    795   4543     marks 	LOG_POOL_VDEV_ATTACH,
    796   4543     marks 	LOG_POOL_VDEV_REPLACE,
    797   4543     marks 	LOG_POOL_VDEV_DETACH,
    798   4543     marks 	LOG_POOL_VDEV_ONLINE,
    799   4543     marks 	LOG_POOL_VDEV_OFFLINE,
    800   4543     marks 	LOG_POOL_UPGRADE,
    801   4543     marks 	LOG_POOL_CLEAR,
    802   4543     marks 	LOG_POOL_SCRUB,
    803   4543     marks 	LOG_POOL_PROPSET,
    804   4543     marks 	LOG_DS_CREATE,
    805   4543     marks 	LOG_DS_CLONE,
    806   4543     marks 	LOG_DS_DESTROY,
    807   4543     marks 	LOG_DS_DESTROY_BEGIN,
    808   4543     marks 	LOG_DS_INHERIT,
    809   4543     marks 	LOG_DS_PROPSET,
    810   4543     marks 	LOG_DS_QUOTA,
    811   4543     marks 	LOG_DS_PERM_UPDATE,
    812   4543     marks 	LOG_DS_PERM_REMOVE,
    813   4543     marks 	LOG_DS_PERM_WHO_REMOVE,
    814   4543     marks 	LOG_DS_PROMOTE,
    815   4543     marks 	LOG_DS_RECEIVE,
    816   4543     marks 	LOG_DS_RENAME,
    817   4543     marks 	LOG_DS_RESERVATION,
    818   4543     marks 	LOG_DS_REPLAY_INC_SYNC,
    819   4543     marks 	LOG_DS_REPLAY_FULL_SYNC,
    820   4543     marks 	LOG_DS_ROLLBACK,
    821   4543     marks 	LOG_DS_SNAPSHOT,
    822   4577    ahrens 	LOG_DS_UPGRADE,
    823   5378  ck153898 	LOG_DS_REFQUOTA,
    824   5378  ck153898 	LOG_DS_REFRESERV,
    825   7046    ahrens 	LOG_POOL_SCRUB_DONE,
    826  10242     chris 	LOG_DS_USER_HOLD,
    827  10242     chris 	LOG_DS_USER_RELEASE,
    828   4543     marks 	LOG_END
    829   4543     marks } history_internal_events_t;
    830   4543     marks 
    831    789    ahrens #ifdef	__cplusplus
    832    789    ahrens }
    833    789    ahrens #endif
    834    789    ahrens 
    835    789    ahrens #endif	/* _SYS_FS_ZFS_H */
    836