usr/src/uts/common/sys/fs/zfs.h
author eschrock
Tue, 30 May 2006 15:47:16 -0700
changeset 2082 76b439ec3ac1
parent 1775 e51e26b432c0
child 2199 712a788c2dfd
permissions -rw-r--r--
PSARC 2006/223 ZFS Hot Spares PSARC 2006/303 ZFS Clone Promotion 6276916 support for "clone swap" 6288488 du reports misleading size on RAID-Z 6393490 libzfs should be a real library 6397148 fbufs debug code should be removed from buf_hash_insert() 6405966 Hot Spare support in ZFS 6409302 passing a non-root vdev via zpool_create() panics system 6415739 assertion failed: !(zio->io_flags & 0x00040) 6416759 ::dbufs does not find bonus buffers anymore 6417978 double parity RAID-Z a.k.a. RAID6 6424554 full block re-writes need not read data in 6425111 detaching an offline device can result in import confusion
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     1
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     2
 * CDDL HEADER START
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     3
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
1485
e971e58d18f6 6322005 support for persistent offline
lling
parents: 1356
diff changeset
     5
 * Common Development and Distribution License (the "License").
e971e58d18f6 6322005 support for persistent offline
lling
parents: 1356
diff changeset
     6
 * You may not use this file except in compliance with the License.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     7
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    11
 * and limitations under the License.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    12
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    18
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    19
 * CDDL HEADER END
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    20
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    21
/*
1352
b7039548de2f 6343802 zpool(1M) should make better use of libdiskmgt
eschrock
parents: 1175
diff changeset
    22
 * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    23
 * Use is subject to license terms.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    24
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    25
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    26
#ifndef	_SYS_FS_ZFS_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    27
#define	_SYS_FS_ZFS_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    28
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    29
#pragma ident	"%Z%%M%	%I%	%E% SMI"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    30
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    31
#include <sys/types.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    32
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    33
#ifdef	__cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    34
extern "C" {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    35
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    36
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    37
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    38
 * Types and constants shared between userland and the kernel.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    39
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    40
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    41
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    42
 * Each dataset can be one of the following types.  These constants can be
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    43
 * combined into masks that can be passed to various functions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    44
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    45
typedef enum {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    46
	ZFS_TYPE_FILESYSTEM	= 0x1,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    47
	ZFS_TYPE_SNAPSHOT	= 0x2,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    48
	ZFS_TYPE_VOLUME		= 0x4
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    49
} zfs_type_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    50
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    51
#define	ZFS_TYPE_ANY	\
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    52
	(ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME | ZFS_TYPE_SNAPSHOT)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    53
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    54
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    55
 * Properties are identified by these constants.  They are arranged in order of
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    56
 * how they should be displayed by 'zfs get'.  If you make any changes to this
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    57
 * list, be sure to update the property table in usr/src/common/zfs/zfs_prop.c.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    58
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    59
typedef enum {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    60
	ZFS_PROP_INVAL = -1,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    61
	ZFS_PROP_TYPE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    62
	ZFS_PROP_CREATION,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    63
	ZFS_PROP_USED,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    64
	ZFS_PROP_AVAILABLE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    65
	ZFS_PROP_REFERENCED,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    66
	ZFS_PROP_COMPRESSRATIO,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    67
	ZFS_PROP_MOUNTED,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    68
	ZFS_PROP_ORIGIN,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    69
	ZFS_PROP_QUOTA,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    70
	ZFS_PROP_RESERVATION,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    71
	ZFS_PROP_VOLSIZE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    72
	ZFS_PROP_VOLBLOCKSIZE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    73
	ZFS_PROP_RECORDSIZE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    74
	ZFS_PROP_MOUNTPOINT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    75
	ZFS_PROP_SHARENFS,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    76
	ZFS_PROP_CHECKSUM,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    77
	ZFS_PROP_COMPRESSION,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    78
	ZFS_PROP_ATIME,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    79
	ZFS_PROP_DEVICES,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    80
	ZFS_PROP_EXEC,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    81
	ZFS_PROP_SETUID,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    82
	ZFS_PROP_READONLY,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    83
	ZFS_PROP_ZONED,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    84
	ZFS_PROP_SNAPDIR,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    85
	ZFS_PROP_ACLMODE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    86
	ZFS_PROP_ACLINHERIT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    87
	/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    88
	 * The following properties are not exposed to the user, but are
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    89
	 * accessible by libzfs clients.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    90
	 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    91
	ZFS_PROP_CREATETXG,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    92
	ZFS_PROP_NAME,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    93
	ZFS_NPROP_ALL
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    94
} zfs_prop_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    95
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    96
#define	ZFS_NPROP_VISIBLE	ZFS_PROP_CREATETXG
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    97
1356
e021b5e4aa0e 6377671 zfs mount -a shouldn't bother checking snapshots
eschrock
parents: 1354
diff changeset
    98
#define	ZFS_PROP_VALUE		"value"
e021b5e4aa0e 6377671 zfs mount -a shouldn't bother checking snapshots
eschrock
parents: 1354
diff changeset
    99
#define	ZFS_PROP_SOURCE		"source"
e021b5e4aa0e 6377671 zfs mount -a shouldn't bother checking snapshots
eschrock
parents: 1354
diff changeset
   100
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   101
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   102
 * The following functions are shared between libzfs and the kernel.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   103
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   104
zfs_prop_t zfs_name_to_prop(const char *);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   105
int zfs_prop_readonly(zfs_prop_t);
1356
e021b5e4aa0e 6377671 zfs mount -a shouldn't bother checking snapshots
eschrock
parents: 1354
diff changeset
   106
const char *zfs_prop_default_string(zfs_prop_t);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   107
uint64_t zfs_prop_default_numeric(zfs_prop_t);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   108
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   109
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   110
/*
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   111
 * On-disk version number.
1760
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   112
 */
1775
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   113
#define	ZFS_VERSION_1			1ULL
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   114
#define	ZFS_VERSION_2			2ULL
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   115
#define	ZFS_VERSION_3			3ULL
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   116
#define	ZFS_VERSION			ZFS_VERSION_3
1775
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   117
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   118
/*
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   119
 * Symbolic names for the changes that caused a ZFS_VERSION switch.
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   120
 * Used in the code when checking for presence or absence of a feature.
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   121
 * Feel free to define multiple symbolic names for each version if there
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   122
 * were multiple changes to on-disk structures during that version.
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   123
 *
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   124
 * NOTE: When checking the current ZFS_VERSION in your code, be sure
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   125
 *       to use spa_version() since it reports the version of the
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   126
 *       last synced uberblock.  Checking the in-flight version can
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   127
 *       be dangerous in some cases.
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   128
 */
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   129
#define	ZFS_VERSION_INITIAL		ZFS_VERSION_1
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   130
#define	ZFS_VERSION_DITTO_BLOCKS	ZFS_VERSION_2
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   131
#define	ZFS_VERSION_SPARES		ZFS_VERSION_3
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   132
#define	ZFS_VERSION_RAID6		ZFS_VERSION_3
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   133
#define	ZFS_VERSION_BPLIST_ACCOUNT	ZFS_VERSION_3
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   134
#define	ZFS_VERSION_RAIDZ_DEFLATE	ZFS_VERSION_3
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   135
#define	ZFS_VERSION_DNODE_BYTES		ZFS_VERSION_3
1760
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   136
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   137
/*
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   138
 * The following are configuration names used in the nvlist describing a pool's
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   139
 * configuration.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   140
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   141
#define	ZPOOL_CONFIG_VERSION		"version"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   142
#define	ZPOOL_CONFIG_POOL_NAME		"name"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   143
#define	ZPOOL_CONFIG_POOL_STATE		"state"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   144
#define	ZPOOL_CONFIG_POOL_TXG		"txg"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   145
#define	ZPOOL_CONFIG_POOL_GUID		"pool_guid"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   146
#define	ZPOOL_CONFIG_CREATE_TXG		"create_txg"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   147
#define	ZPOOL_CONFIG_TOP_GUID		"top_guid"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   148
#define	ZPOOL_CONFIG_POOL_HEALTH	"pool_health"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   149
#define	ZPOOL_CONFIG_VDEV_TREE		"vdev_tree"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   150
#define	ZPOOL_CONFIG_TYPE		"type"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   151
#define	ZPOOL_CONFIG_CHILDREN		"children"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   152
#define	ZPOOL_CONFIG_ID			"id"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   153
#define	ZPOOL_CONFIG_GUID		"guid"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   154
#define	ZPOOL_CONFIG_PATH		"path"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   155
#define	ZPOOL_CONFIG_DEVID		"devid"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   156
#define	ZPOOL_CONFIG_METASLAB_ARRAY	"metaslab_array"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   157
#define	ZPOOL_CONFIG_METASLAB_SHIFT	"metaslab_shift"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   158
#define	ZPOOL_CONFIG_ASHIFT		"ashift"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   159
#define	ZPOOL_CONFIG_ASIZE		"asize"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   160
#define	ZPOOL_CONFIG_DTL		"DTL"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   161
#define	ZPOOL_CONFIG_STATS		"stats"
1171
b501e9f31cab 6344272 re-think how whole disks are stored
eschrock
parents: 789
diff changeset
   162
#define	ZPOOL_CONFIG_WHOLE_DISK		"whole_disk"
1485
e971e58d18f6 6322005 support for persistent offline
lling
parents: 1356
diff changeset
   163
#define	ZPOOL_CONFIG_OFFLINE		"offline"
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   164
#define	ZPOOL_CONFIG_ERRCOUNT		"error_count"
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   165
#define	ZPOOL_CONFIG_NOT_PRESENT	"not_present"
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   166
#define	ZPOOL_CONFIG_SPARES		"spares"
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   167
#define	ZPOOL_CONFIG_IS_SPARE		"is_spare"
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   168
#define	ZPOOL_CONFIG_NPARITY		"nparity"
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   169
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   170
#define	VDEV_TYPE_ROOT			"root"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   171
#define	VDEV_TYPE_MIRROR		"mirror"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   172
#define	VDEV_TYPE_REPLACING		"replacing"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   173
#define	VDEV_TYPE_RAIDZ			"raidz"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   174
#define	VDEV_TYPE_DISK			"disk"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   175
#define	VDEV_TYPE_FILE			"file"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   176
#define	VDEV_TYPE_MISSING		"missing"
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   177
#define	VDEV_TYPE_SPARE			"spare"
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   178
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   179
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   180
 * This is needed in userland to report the minimum necessary device size.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   181
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   182
#define	SPA_MINDEVSIZE		(64ULL << 20)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   183
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   184
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   185
 * The location of the pool configuration repository, shared between kernel and
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   186
 * userland.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   187
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   188
#define	ZPOOL_CACHE_DIR		"/etc/zfs"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   189
#define	ZPOOL_CACHE_FILE	"zpool.cache"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   190
#define	ZPOOL_CACHE_TMP		".zpool.cache"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   191
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   192
#define	ZPOOL_CACHE		ZPOOL_CACHE_DIR "/" ZPOOL_CACHE_FILE
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   193
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   194
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   195
 * vdev states are ordered from least to most healthy.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   196
 * A vdev that's CANT_OPEN or below is considered unusable.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   197
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   198
typedef enum vdev_state {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   199
	VDEV_STATE_UNKNOWN = 0,	/* Uninitialized vdev			*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   200
	VDEV_STATE_CLOSED,	/* Not currently open			*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   201
	VDEV_STATE_OFFLINE,	/* Not allowed to open			*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   202
	VDEV_STATE_CANT_OPEN,	/* Tried to open, but failed		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   203
	VDEV_STATE_DEGRADED,	/* Replicated vdev with unhealthy kids	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   204
	VDEV_STATE_HEALTHY	/* Presumed good			*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   205
} vdev_state_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   206
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   207
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   208
 * vdev aux states.  When a vdev is in the CANT_OPEN state, the aux field
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   209
 * of the vdev stats structure uses these constants to distinguish why.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   210
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   211
typedef enum vdev_aux {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   212
	VDEV_AUX_NONE,		/* no error				*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   213
	VDEV_AUX_OPEN_FAILED,	/* ldi_open_*() or vn_open() failed	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   214
	VDEV_AUX_CORRUPT_DATA,	/* bad label or disk contents		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   215
	VDEV_AUX_NO_REPLICAS,	/* insufficient number of replicas	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   216
	VDEV_AUX_BAD_GUID_SUM,	/* vdev guid sum doesn't match		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   217
	VDEV_AUX_TOO_SMALL,	/* vdev size is too small		*/
1760
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   218
	VDEV_AUX_BAD_LABEL,	/* the label is OK but invalid		*/
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   219
	VDEV_AUX_VERSION_NEWER,	/* on-disk version is too new		*/
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   220
	VDEV_AUX_VERSION_OLDER,	/* on-disk version is too old		*/
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   221
	VDEV_AUX_SPARED		/* hot spare used in another pool	*/
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   222
} vdev_aux_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   223
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   224
/*
1352
b7039548de2f 6343802 zpool(1M) should make better use of libdiskmgt
eschrock
parents: 1175
diff changeset
   225
 * pool state.  The following states are written to disk as part of the normal
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   226
 * SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE.  The remaining states are
1352
b7039548de2f 6343802 zpool(1M) should make better use of libdiskmgt
eschrock
parents: 1175
diff changeset
   227
 * software abstractions used at various levels to communicate pool state.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   228
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   229
typedef enum pool_state {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   230
	POOL_STATE_ACTIVE = 0,		/* In active use		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   231
	POOL_STATE_EXPORTED,		/* Explicitly exported		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   232
	POOL_STATE_DESTROYED,		/* Explicitly destroyed		*/
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   233
	POOL_STATE_SPARE,		/* Reserved for hot spare use	*/
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   234
	POOL_STATE_UNINITIALIZED,	/* Internal spa_t state		*/
1352
b7039548de2f 6343802 zpool(1M) should make better use of libdiskmgt
eschrock
parents: 1175
diff changeset
   235
	POOL_STATE_UNAVAIL,		/* Internal libzfs state	*/
b7039548de2f 6343802 zpool(1M) should make better use of libdiskmgt
eschrock
parents: 1175
diff changeset
   236
	POOL_STATE_POTENTIALLY_ACTIVE	/* Internal libzfs state	*/
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   237
} pool_state_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   238
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   239
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   240
 * Scrub types.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   241
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   242
typedef enum pool_scrub_type {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   243
	POOL_SCRUB_NONE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   244
	POOL_SCRUB_RESILVER,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   245
	POOL_SCRUB_EVERYTHING,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   246
	POOL_SCRUB_TYPES
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   247
} pool_scrub_type_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   248
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   249
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   250
 * ZIO types.  Needed to interpret vdev statistics below.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   251
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   252
typedef enum zio_type {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   253
	ZIO_TYPE_NULL = 0,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   254
	ZIO_TYPE_READ,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   255
	ZIO_TYPE_WRITE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   256
	ZIO_TYPE_FREE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   257
	ZIO_TYPE_CLAIM,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   258
	ZIO_TYPE_IOCTL,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   259
	ZIO_TYPES
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   260
} zio_type_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   261
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   262
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   263
 * Vdev statistics.  Note: all fields should be 64-bit because this
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   264
 * is passed between kernel and userland as an nvlist uint64 array.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   265
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   266
typedef struct vdev_stat {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   267
	hrtime_t	vs_timestamp;		/* time since vdev load	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   268
	uint64_t	vs_state;		/* vdev state		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   269
	uint64_t	vs_aux;			/* see vdev_aux_t	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   270
	uint64_t	vs_alloc;		/* space allocated	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   271
	uint64_t	vs_space;		/* total capacity	*/
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   272
	uint64_t	vs_dspace;		/* deflated capacity	*/
1175
759d20c7e57b 6366265 attach/replace should allow a new device size at least the min of all devs in a mirror/raidz
lling
parents: 1171
diff changeset
   273
	uint64_t	vs_rsize;		/* replaceable dev size */
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   274
	uint64_t	vs_ops[ZIO_TYPES];	/* operation count	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   275
	uint64_t	vs_bytes[ZIO_TYPES];	/* bytes read/written	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   276
	uint64_t	vs_read_errors;		/* read errors		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   277
	uint64_t	vs_write_errors;	/* write errors		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   278
	uint64_t	vs_checksum_errors;	/* checksum errors	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   279
	uint64_t	vs_self_healed;		/* self-healed bytes	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   280
	uint64_t	vs_scrub_type;		/* pool_scrub_type_t	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   281
	uint64_t	vs_scrub_complete;	/* completed?		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   282
	uint64_t	vs_scrub_examined;	/* bytes examined; top	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   283
	uint64_t	vs_scrub_repaired;	/* bytes repaired; leaf	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   284
	uint64_t	vs_scrub_errors;	/* errors during scrub	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   285
	uint64_t	vs_scrub_start;		/* UTC scrub start time	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   286
	uint64_t	vs_scrub_end;		/* UTC scrub end time	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   287
} vdev_stat_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   288
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   289
#define	ZFS_DRIVER	"zfs"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   290
#define	ZFS_DEV		"/dev/zfs"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   291
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   292
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   293
 * zvol paths.  Irritatingly, the devfsadm interfaces want all these
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   294
 * paths without the /dev prefix, but for some things, we want the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   295
 * /dev prefix.  Below are the names without /dev.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   296
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   297
#define	ZVOL_DEV_DIR	"zvol/dsk"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   298
#define	ZVOL_RDEV_DIR	"zvol/rdsk"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   299
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   300
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   301
 * And here are the things we need with /dev, etc. in front of them.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   302
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   303
#define	ZVOL_PSEUDO_DEV		"/devices/pseudo/zvol@0:"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   304
#define	ZVOL_FULL_DEV_DIR	"/dev/" ZVOL_DEV_DIR
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   305
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   306
#define	ZVOL_PROP_NAME		"name"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   307
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   308
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   309
 * /dev/zfs ioctl numbers.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   310
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   311
#define	ZFS_IOC		('Z' << 8)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   312
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   313
typedef enum zfs_ioc {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   314
	ZFS_IOC_POOL_CREATE = ZFS_IOC,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   315
	ZFS_IOC_POOL_DESTROY,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   316
	ZFS_IOC_POOL_IMPORT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   317
	ZFS_IOC_POOL_EXPORT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   318
	ZFS_IOC_POOL_CONFIGS,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   319
	ZFS_IOC_POOL_STATS,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   320
	ZFS_IOC_POOL_TRYIMPORT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   321
	ZFS_IOC_POOL_SCRUB,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   322
	ZFS_IOC_POOL_FREEZE,
1760
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   323
	ZFS_IOC_POOL_UPGRADE,
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   324
	ZFS_IOC_VDEV_ADD,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   325
	ZFS_IOC_VDEV_REMOVE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   326
	ZFS_IOC_VDEV_ONLINE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   327
	ZFS_IOC_VDEV_OFFLINE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   328
	ZFS_IOC_VDEV_ATTACH,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   329
	ZFS_IOC_VDEV_DETACH,
1354
81359ee1ee63 6362672 import gets confused about overlapping slices
eschrock
parents: 1352
diff changeset
   330
	ZFS_IOC_VDEV_SETPATH,
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   331
	ZFS_IOC_OBJSET_STATS,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   332
	ZFS_IOC_DATASET_LIST_NEXT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   333
	ZFS_IOC_SNAPSHOT_LIST_NEXT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   334
	ZFS_IOC_SET_PROP,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   335
	ZFS_IOC_SET_QUOTA,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   336
	ZFS_IOC_SET_RESERVATION,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   337
	ZFS_IOC_SET_VOLSIZE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   338
	ZFS_IOC_SET_VOLBLOCKSIZE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   339
	ZFS_IOC_CREATE_MINOR,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   340
	ZFS_IOC_REMOVE_MINOR,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   341
	ZFS_IOC_CREATE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   342
	ZFS_IOC_DESTROY,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   343
	ZFS_IOC_ROLLBACK,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   344
	ZFS_IOC_RENAME,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   345
	ZFS_IOC_RECVBACKUP,
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   346
	ZFS_IOC_SENDBACKUP,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   347
	ZFS_IOC_INJECT_FAULT,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   348
	ZFS_IOC_CLEAR_FAULT,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   349
	ZFS_IOC_INJECT_LIST_NEXT,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   350
	ZFS_IOC_ERROR_LOG,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   351
	ZFS_IOC_CLEAR,
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   352
	ZFS_IOC_BOOKMARK_NAME,
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   353
	ZFS_IOC_PROMOTE
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   354
} zfs_ioc_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   355
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   356
/*
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   357
 * Internal SPA load state.  Used by FMA diagnosis engine.
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   358
 */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   359
typedef enum {
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   360
	SPA_LOAD_NONE,		/* no load in progress */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   361
	SPA_LOAD_OPEN,		/* normal open */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   362
	SPA_LOAD_IMPORT,	/* import in progress */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   363
	SPA_LOAD_TRYIMPORT	/* tryimport in progress */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   364
} spa_load_state_t;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   365
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   366
#ifdef	__cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   367
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   368
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   369
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   370
#endif	/* _SYS_FS_ZFS_H */