usr/src/uts/common/sys/fs/zfs.h
author perrin
Fri, 22 Jun 2007 20:02:13 -0700
changeset 4527 5d5b6ba91b17
parent 4451 24fbf2d7a5d7
child 4543 12bb2876a62e
permissions -rw-r--r--
PSARC 2007/171 ZFS Separate Intent Log 6339640 Make ZIL use NVRAM when available.
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
/*
3377
a2fa338530c1 6393525 vdev_reopen() should verify that it's still the same device
eschrock
parents: 3234
diff changeset
    22
 * Copyright 2007 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,
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
    48
	ZFS_TYPE_VOLUME		= 0x4,
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
    49
	ZFS_TYPE_POOL		= 0x8
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    50
} zfs_type_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    51
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    52
#define	ZFS_TYPE_ANY	\
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    53
	(ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME | ZFS_TYPE_SNAPSHOT)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    54
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    55
/*
3654
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
    56
 * Properties are identified by these constants and must be added to the
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
    57
 * end of this list to ensure that external consumers are not affected
3654
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
    58
 * by the change. The property list also determines how 'zfs get' will
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
    59
 * display them.  If you make any changes to this list, be sure to update
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
    60
 * the property table in usr/src/common/zfs/zfs_prop.c.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    61
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    62
typedef enum {
3654
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
    63
	ZFS_PROP_CONT = -2,
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    64
	ZFS_PROP_INVAL = -1,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    65
	ZFS_PROP_TYPE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    66
	ZFS_PROP_CREATION,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    67
	ZFS_PROP_USED,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    68
	ZFS_PROP_AVAILABLE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    69
	ZFS_PROP_REFERENCED,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    70
	ZFS_PROP_COMPRESSRATIO,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    71
	ZFS_PROP_MOUNTED,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    72
	ZFS_PROP_ORIGIN,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    73
	ZFS_PROP_QUOTA,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    74
	ZFS_PROP_RESERVATION,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    75
	ZFS_PROP_VOLSIZE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    76
	ZFS_PROP_VOLBLOCKSIZE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    77
	ZFS_PROP_RECORDSIZE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    78
	ZFS_PROP_MOUNTPOINT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    79
	ZFS_PROP_SHARENFS,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    80
	ZFS_PROP_CHECKSUM,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    81
	ZFS_PROP_COMPRESSION,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    82
	ZFS_PROP_ATIME,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    83
	ZFS_PROP_DEVICES,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    84
	ZFS_PROP_EXEC,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    85
	ZFS_PROP_SETUID,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    86
	ZFS_PROP_READONLY,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    87
	ZFS_PROP_ZONED,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    88
	ZFS_PROP_SNAPDIR,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    89
	ZFS_PROP_ACLMODE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    90
	ZFS_PROP_ACLINHERIT,
3654
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
    91
	ZFS_PROP_CREATETXG,		/* not exposed to the user */
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
    92
	ZFS_PROP_NAME,			/* not exposed to the user */
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
    93
	ZFS_PROP_CANMOUNT,
3654
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
    94
	ZFS_PROP_SHAREISCSI,
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
    95
	ZFS_PROP_ISCSIOPTIONS,		/* not exposed to the user */
3234
28b36f7bbd7e PSARC/2006/638 noxattr ZFS property
ck153898
parents: 3126
diff changeset
    96
	ZFS_PROP_XATTR,
3835
063f0749804a PSARC/2007/121 zfs set copies
ahrens
parents: 3741
diff changeset
    97
	ZFS_PROP_NUMCLONES,		/* not exposed to the user */
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
    98
	ZFS_PROP_COPIES,
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
    99
	ZPOOL_PROP_BOOTFS,
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   100
	ZPOOL_PROP_AUTOREPLACE,
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   101
	ZPOOL_PROP_NAME
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   102
} zfs_prop_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   103
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   104
typedef zfs_prop_t zpool_prop_t;
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   105
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   106
#define	ZPOOL_PROP_CONT		ZFS_PROP_CONT
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   107
#define	ZPOOL_PROP_INVAL	ZFS_PROP_INVAL
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   108
1356
e021b5e4aa0e 6377671 zfs mount -a shouldn't bother checking snapshots
eschrock
parents: 1354
diff changeset
   109
#define	ZFS_PROP_VALUE		"value"
e021b5e4aa0e 6377671 zfs mount -a shouldn't bother checking snapshots
eschrock
parents: 1354
diff changeset
   110
#define	ZFS_PROP_SOURCE		"source"
e021b5e4aa0e 6377671 zfs mount -a shouldn't bother checking snapshots
eschrock
parents: 1354
diff changeset
   111
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   112
typedef enum {
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   113
	ZFS_SRC_NONE = 0x1,
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   114
	ZFS_SRC_DEFAULT = 0x2,
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   115
	ZFS_SRC_TEMPORARY = 0x4,
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   116
	ZFS_SRC_LOCAL = 0x8,
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   117
	ZFS_SRC_INHERITED = 0x10
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   118
} zfs_source_t;
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   119
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   120
#define	ZFS_SRC_ALL	0x1f
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   121
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   122
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   123
 * The following functions are shared between libzfs and the kernel.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   124
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   125
zfs_prop_t zfs_name_to_prop(const char *);
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   126
zpool_prop_t zpool_name_to_prop(const char *);
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
   127
boolean_t zfs_prop_user(const char *);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   128
int zfs_prop_readonly(zfs_prop_t);
1356
e021b5e4aa0e 6377671 zfs mount -a shouldn't bother checking snapshots
eschrock
parents: 1354
diff changeset
   129
const char *zfs_prop_default_string(zfs_prop_t);
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
   130
const char *zfs_prop_to_name(zfs_prop_t);
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   131
const char *zpool_prop_to_name(zpool_prop_t);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   132
uint64_t zfs_prop_default_numeric(zfs_prop_t);
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
   133
int zfs_prop_inheritable(zfs_prop_t);
2717
ed589a32259d 6469385 zfs_set_prop_nvlist range checking is busted
eschrock
parents: 2676
diff changeset
   134
int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *);
ed589a32259d 6469385 zfs_set_prop_nvlist range checking is busted
eschrock
parents: 2676
diff changeset
   135
int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **);
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   136
uint64_t zpool_prop_default_numeric(zpool_prop_t);
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   137
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   138
/*
3654
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
   139
 * Property Iterator
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
   140
 */
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
   141
typedef zfs_prop_t (*zfs_prop_f)(zfs_prop_t, void *);
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   142
typedef zpool_prop_t (*zpool_prop_f)(zpool_prop_t, void *);
3654
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
   143
extern zfs_prop_t zfs_prop_iter(zfs_prop_f, void *, boolean_t);
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   144
extern zpool_prop_t zpool_prop_iter(zpool_prop_f, void *, boolean_t);
3654
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
   145
9c6042b08979 6483718 need a stable interface to get all native properties
gw25295
parents: 3444
diff changeset
   146
/*
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   147
 * On-disk version number.
1760
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   148
 */
1775
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   149
#define	ZFS_VERSION_1			1ULL
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   150
#define	ZFS_VERSION_2			2ULL
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   151
#define	ZFS_VERSION_3			3ULL
3863
d56571426115 6529406 zpool history needs to bump the on-disk version
ek110237
parents: 3835
diff changeset
   152
#define	ZFS_VERSION_4			4ULL
3886
3291401d66a6 6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents: 3863
diff changeset
   153
#define	ZFS_VERSION_5			5ULL
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   154
#define	ZFS_VERSION_6			6ULL
4527
5d5b6ba91b17 PSARC 2007/171 ZFS Separate Intent Log
perrin
parents: 4451
diff changeset
   155
#define	ZFS_VERSION_7			7ULL
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   156
/*
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   157
 * When bumping up ZFS_VERSION, make sure GRUB ZFS understand the on-disk
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   158
 * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*},
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   159
 * and do the appropriate changes.
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   160
 */
4527
5d5b6ba91b17 PSARC 2007/171 ZFS Separate Intent Log
perrin
parents: 4451
diff changeset
   161
#define	ZFS_VERSION			ZFS_VERSION_7
5d5b6ba91b17 PSARC 2007/171 ZFS Separate Intent Log
perrin
parents: 4451
diff changeset
   162
#define	ZFS_VERSION_STRING		"7"
1775
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   163
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   164
/*
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   165
 * 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
   166
 * 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
   167
 * 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
   168
 * 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
   169
 *
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   170
 * 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
   171
 *       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
   172
 *       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
   173
 *       be dangerous in some cases.
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   174
 */
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   175
#define	ZFS_VERSION_INITIAL		ZFS_VERSION_1
e51e26b432c0 6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents: 1760
diff changeset
   176
#define	ZFS_VERSION_DITTO_BLOCKS	ZFS_VERSION_2
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   177
#define	ZFS_VERSION_SPARES		ZFS_VERSION_3
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   178
#define	ZFS_VERSION_RAID6		ZFS_VERSION_3
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   179
#define	ZFS_VERSION_BPLIST_ACCOUNT	ZFS_VERSION_3
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   180
#define	ZFS_VERSION_RAIDZ_DEFLATE	ZFS_VERSION_3
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   181
#define	ZFS_VERSION_DNODE_BYTES		ZFS_VERSION_3
3863
d56571426115 6529406 zpool history needs to bump the on-disk version
ek110237
parents: 3835
diff changeset
   182
#define	ZFS_VERSION_ZPOOL_HISTORY	ZFS_VERSION_4
3886
3291401d66a6 6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents: 3863
diff changeset
   183
#define	ZFS_VERSION_GZIP_COMPRESSION	ZFS_VERSION_5
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   184
#define	ZFS_VERSION_BOOTFS		ZFS_VERSION_6
4527
5d5b6ba91b17 PSARC 2007/171 ZFS Separate Intent Log
perrin
parents: 4451
diff changeset
   185
#define	ZFS_VERSION_SLOGS		ZFS_VERSION_7
1760
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   186
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   187
/*
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   188
 * The following are configuration names used in the nvlist describing a pool's
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   189
 * configuration.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   190
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   191
#define	ZPOOL_CONFIG_VERSION		"version"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   192
#define	ZPOOL_CONFIG_POOL_NAME		"name"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   193
#define	ZPOOL_CONFIG_POOL_STATE		"state"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   194
#define	ZPOOL_CONFIG_POOL_TXG		"txg"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   195
#define	ZPOOL_CONFIG_POOL_GUID		"pool_guid"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   196
#define	ZPOOL_CONFIG_CREATE_TXG		"create_txg"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   197
#define	ZPOOL_CONFIG_TOP_GUID		"top_guid"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   198
#define	ZPOOL_CONFIG_VDEV_TREE		"vdev_tree"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   199
#define	ZPOOL_CONFIG_TYPE		"type"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   200
#define	ZPOOL_CONFIG_CHILDREN		"children"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   201
#define	ZPOOL_CONFIG_ID			"id"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   202
#define	ZPOOL_CONFIG_GUID		"guid"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   203
#define	ZPOOL_CONFIG_PATH		"path"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   204
#define	ZPOOL_CONFIG_DEVID		"devid"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   205
#define	ZPOOL_CONFIG_METASLAB_ARRAY	"metaslab_array"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   206
#define	ZPOOL_CONFIG_METASLAB_SHIFT	"metaslab_shift"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   207
#define	ZPOOL_CONFIG_ASHIFT		"ashift"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   208
#define	ZPOOL_CONFIG_ASIZE		"asize"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   209
#define	ZPOOL_CONFIG_DTL		"DTL"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   210
#define	ZPOOL_CONFIG_STATS		"stats"
1171
b501e9f31cab 6344272 re-think how whole disks are stored
eschrock
parents: 789
diff changeset
   211
#define	ZPOOL_CONFIG_WHOLE_DISK		"whole_disk"
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   212
#define	ZPOOL_CONFIG_ERRCOUNT		"error_count"
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   213
#define	ZPOOL_CONFIG_NOT_PRESENT	"not_present"
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   214
#define	ZPOOL_CONFIG_SPARES		"spares"
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   215
#define	ZPOOL_CONFIG_IS_SPARE		"is_spare"
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   216
#define	ZPOOL_CONFIG_NPARITY		"nparity"
3975
6674f5d79069 6282725 hostname/hostid should be stored in the label
ek110237
parents: 3912
diff changeset
   217
#define	ZPOOL_CONFIG_HOSTID		"hostid"
6674f5d79069 6282725 hostname/hostid should be stored in the label
ek110237
parents: 3912
diff changeset
   218
#define	ZPOOL_CONFIG_HOSTNAME		"hostname"
6674f5d79069 6282725 hostname/hostid should be stored in the label
ek110237
parents: 3912
diff changeset
   219
#define	ZPOOL_CONFIG_TIMESTAMP		"timestamp" /* not stored on disk */
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   220
#define	ZPOOL_CONFIG_UNSPARE		"unspare"
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   221
#define	ZPOOL_CONFIG_PHYS_PATH		"phys_path"
4527
5d5b6ba91b17 PSARC 2007/171 ZFS Separate Intent Log
perrin
parents: 4451
diff changeset
   222
#define	ZPOOL_CONFIG_IS_LOG		"is_log"
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   223
/*
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   224
 * The persistent vdev state is stored as separate values rather than a single
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   225
 * 'vdev_state' entry.  This is because a device can be in multiple states, such
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   226
 * as offline and degraded.
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   227
 */
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   228
#define	ZPOOL_CONFIG_OFFLINE		"offline"
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   229
#define	ZPOOL_CONFIG_FAULTED		"faulted"
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   230
#define	ZPOOL_CONFIG_DEGRADED		"degraded"
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   231
#define	ZPOOL_CONFIG_REMOVED		"removed"
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   232
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   233
#define	VDEV_TYPE_ROOT			"root"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   234
#define	VDEV_TYPE_MIRROR		"mirror"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   235
#define	VDEV_TYPE_REPLACING		"replacing"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   236
#define	VDEV_TYPE_RAIDZ			"raidz"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   237
#define	VDEV_TYPE_DISK			"disk"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   238
#define	VDEV_TYPE_FILE			"file"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   239
#define	VDEV_TYPE_MISSING		"missing"
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   240
#define	VDEV_TYPE_SPARE			"spare"
4527
5d5b6ba91b17 PSARC 2007/171 ZFS Separate Intent Log
perrin
parents: 4451
diff changeset
   241
#define	VDEV_TYPE_LOG			"log"
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   242
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   243
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   244
 * This is needed in userland to report the minimum necessary device size.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   245
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   246
#define	SPA_MINDEVSIZE		(64ULL << 20)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   247
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   248
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   249
 * The location of the pool configuration repository, shared between kernel and
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   250
 * userland.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   251
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   252
#define	ZPOOL_CACHE_DIR		"/etc/zfs"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   253
#define	ZPOOL_CACHE_FILE	"zpool.cache"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   254
#define	ZPOOL_CACHE_TMP		".zpool.cache"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   255
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   256
#define	ZPOOL_CACHE		ZPOOL_CACHE_DIR "/" ZPOOL_CACHE_FILE
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   257
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   258
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   259
 * vdev states are ordered from least to most healthy.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   260
 * A vdev that's CANT_OPEN or below is considered unusable.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   261
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   262
typedef enum vdev_state {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   263
	VDEV_STATE_UNKNOWN = 0,	/* Uninitialized vdev			*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   264
	VDEV_STATE_CLOSED,	/* Not currently open			*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   265
	VDEV_STATE_OFFLINE,	/* Not allowed to open			*/
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   266
	VDEV_STATE_REMOVED,	/* Explicitly removed from system	*/
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   267
	VDEV_STATE_CANT_OPEN,	/* Tried to open, but failed		*/
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   268
	VDEV_STATE_FAULTED,	/* External request to fault device	*/
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   269
	VDEV_STATE_DEGRADED,	/* Replicated vdev with unhealthy kids	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   270
	VDEV_STATE_HEALTHY	/* Presumed good			*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   271
} vdev_state_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   272
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   273
#define	VDEV_STATE_ONLINE	VDEV_STATE_HEALTHY
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   274
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   275
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   276
 * vdev aux states.  When a vdev is in the CANT_OPEN state, the aux field
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   277
 * of the vdev stats structure uses these constants to distinguish why.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   278
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   279
typedef enum vdev_aux {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   280
	VDEV_AUX_NONE,		/* no error				*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   281
	VDEV_AUX_OPEN_FAILED,	/* ldi_open_*() or vn_open() failed	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   282
	VDEV_AUX_CORRUPT_DATA,	/* bad label or disk contents		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   283
	VDEV_AUX_NO_REPLICAS,	/* insufficient number of replicas	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   284
	VDEV_AUX_BAD_GUID_SUM,	/* vdev guid sum doesn't match		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   285
	VDEV_AUX_TOO_SMALL,	/* vdev size is too small		*/
1760
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   286
	VDEV_AUX_BAD_LABEL,	/* the label is OK but invalid		*/
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   287
	VDEV_AUX_VERSION_NEWER,	/* on-disk version is too new		*/
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   288
	VDEV_AUX_VERSION_OLDER,	/* on-disk version is too old		*/
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   289
	VDEV_AUX_SPARED,	/* hot spare used in another pool	*/
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   290
	VDEV_AUX_ERR_EXCEEDED	/* too many errors			*/
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   291
} vdev_aux_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   292
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   293
/*
1352
b7039548de2f 6343802 zpool(1M) should make better use of libdiskmgt
eschrock
parents: 1175
diff changeset
   294
 * 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
   295
 * 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
   296
 * software abstractions used at various levels to communicate pool state.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   297
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   298
typedef enum pool_state {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   299
	POOL_STATE_ACTIVE = 0,		/* In active use		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   300
	POOL_STATE_EXPORTED,		/* Explicitly exported		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   301
	POOL_STATE_DESTROYED,		/* Explicitly destroyed		*/
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   302
	POOL_STATE_SPARE,		/* Reserved for hot spare use	*/
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   303
	POOL_STATE_UNINITIALIZED,	/* Internal spa_t state		*/
1352
b7039548de2f 6343802 zpool(1M) should make better use of libdiskmgt
eschrock
parents: 1175
diff changeset
   304
	POOL_STATE_UNAVAIL,		/* Internal libzfs state	*/
b7039548de2f 6343802 zpool(1M) should make better use of libdiskmgt
eschrock
parents: 1175
diff changeset
   305
	POOL_STATE_POTENTIALLY_ACTIVE	/* Internal libzfs state	*/
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   306
} pool_state_t;
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
 * Scrub types.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   310
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   311
typedef enum pool_scrub_type {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   312
	POOL_SCRUB_NONE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   313
	POOL_SCRUB_RESILVER,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   314
	POOL_SCRUB_EVERYTHING,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   315
	POOL_SCRUB_TYPES
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   316
} pool_scrub_type_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   317
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   318
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   319
 * ZIO types.  Needed to interpret vdev statistics below.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   320
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   321
typedef enum zio_type {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   322
	ZIO_TYPE_NULL = 0,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   323
	ZIO_TYPE_READ,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   324
	ZIO_TYPE_WRITE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   325
	ZIO_TYPE_FREE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   326
	ZIO_TYPE_CLAIM,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   327
	ZIO_TYPE_IOCTL,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   328
	ZIO_TYPES
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   329
} zio_type_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   330
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   331
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   332
 * Vdev statistics.  Note: all fields should be 64-bit because this
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   333
 * is passed between kernel and userland as an nvlist uint64 array.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   334
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   335
typedef struct vdev_stat {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   336
	hrtime_t	vs_timestamp;		/* time since vdev load	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   337
	uint64_t	vs_state;		/* vdev state		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   338
	uint64_t	vs_aux;			/* see vdev_aux_t	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   339
	uint64_t	vs_alloc;		/* space allocated	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   340
	uint64_t	vs_space;		/* total capacity	*/
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1775
diff changeset
   341
	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
   342
	uint64_t	vs_rsize;		/* replaceable dev size */
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   343
	uint64_t	vs_ops[ZIO_TYPES];	/* operation count	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   344
	uint64_t	vs_bytes[ZIO_TYPES];	/* bytes read/written	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   345
	uint64_t	vs_read_errors;		/* read errors		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   346
	uint64_t	vs_write_errors;	/* write errors		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   347
	uint64_t	vs_checksum_errors;	/* checksum errors	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   348
	uint64_t	vs_self_healed;		/* self-healed bytes	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   349
	uint64_t	vs_scrub_type;		/* pool_scrub_type_t	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   350
	uint64_t	vs_scrub_complete;	/* completed?		*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   351
	uint64_t	vs_scrub_examined;	/* bytes examined; top	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   352
	uint64_t	vs_scrub_repaired;	/* bytes repaired; leaf	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   353
	uint64_t	vs_scrub_errors;	/* errors during scrub	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   354
	uint64_t	vs_scrub_start;		/* UTC scrub start time	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   355
	uint64_t	vs_scrub_end;		/* UTC scrub end time	*/
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   356
} vdev_stat_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   357
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   358
#define	ZFS_DRIVER	"zfs"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   359
#define	ZFS_DEV		"/dev/zfs"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   360
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   361
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   362
 * zvol paths.  Irritatingly, the devfsadm interfaces want all these
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   363
 * paths without the /dev prefix, but for some things, we want the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   364
 * /dev prefix.  Below are the names without /dev.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   365
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   366
#define	ZVOL_DEV_DIR	"zvol/dsk"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   367
#define	ZVOL_RDEV_DIR	"zvol/rdsk"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   368
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   369
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   370
 * And here are the things we need with /dev, etc. in front of them.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   371
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   372
#define	ZVOL_PSEUDO_DEV		"/devices/pseudo/zvol@0:"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   373
#define	ZVOL_FULL_DEV_DIR	"/dev/" ZVOL_DEV_DIR
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   374
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   375
#define	ZVOL_PROP_NAME		"name"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   376
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   377
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   378
 * /dev/zfs ioctl numbers.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   379
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   380
#define	ZFS_IOC		('Z' << 8)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   381
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   382
typedef enum zfs_ioc {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   383
	ZFS_IOC_POOL_CREATE = ZFS_IOC,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   384
	ZFS_IOC_POOL_DESTROY,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   385
	ZFS_IOC_POOL_IMPORT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   386
	ZFS_IOC_POOL_EXPORT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   387
	ZFS_IOC_POOL_CONFIGS,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   388
	ZFS_IOC_POOL_STATS,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   389
	ZFS_IOC_POOL_TRYIMPORT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   390
	ZFS_IOC_POOL_SCRUB,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   391
	ZFS_IOC_POOL_FREEZE,
1760
e1ad2821c30d PSARC 2006/206 zpool upgrade
eschrock
parents: 1544
diff changeset
   392
	ZFS_IOC_POOL_UPGRADE,
2926
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   393
	ZFS_IOC_POOL_GET_HISTORY,
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   394
	ZFS_IOC_POOL_LOG_HISTORY,
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   395
	ZFS_IOC_VDEV_ADD,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   396
	ZFS_IOC_VDEV_REMOVE,
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   397
	ZFS_IOC_VDEV_SET_STATE,
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   398
	ZFS_IOC_VDEV_ATTACH,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   399
	ZFS_IOC_VDEV_DETACH,
1354
81359ee1ee63 6362672 import gets confused about overlapping slices
eschrock
parents: 1352
diff changeset
   400
	ZFS_IOC_VDEV_SETPATH,
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   401
	ZFS_IOC_OBJSET_STATS,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   402
	ZFS_IOC_DATASET_LIST_NEXT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   403
	ZFS_IOC_SNAPSHOT_LIST_NEXT,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   404
	ZFS_IOC_SET_PROP,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   405
	ZFS_IOC_CREATE_MINOR,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   406
	ZFS_IOC_REMOVE_MINOR,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   407
	ZFS_IOC_CREATE,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   408
	ZFS_IOC_DESTROY,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   409
	ZFS_IOC_ROLLBACK,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   410
	ZFS_IOC_RENAME,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   411
	ZFS_IOC_RECVBACKUP,
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   412
	ZFS_IOC_SENDBACKUP,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   413
	ZFS_IOC_INJECT_FAULT,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   414
	ZFS_IOC_CLEAR_FAULT,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   415
	ZFS_IOC_INJECT_LIST_NEXT,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   416
	ZFS_IOC_ERROR_LOG,
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   417
	ZFS_IOC_CLEAR,
2199
712a788c2dfd PSARC 2006/388 snapshot -r
ahrens
parents: 2082
diff changeset
   418
	ZFS_IOC_PROMOTE,
712a788c2dfd PSARC 2006/388 snapshot -r
ahrens
parents: 2082
diff changeset
   419
	ZFS_IOC_DESTROY_SNAPS,
3444
dc160a70a50d 6410433 'zpool status -v' would be more useful with filenames
ek110237
parents: 3377
diff changeset
   420
	ZFS_IOC_SNAPSHOT,
dc160a70a50d 6410433 'zpool status -v' would be more useful with filenames
ek110237
parents: 3377
diff changeset
   421
	ZFS_IOC_DSOBJ_TO_DSNAME,
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   422
	ZFS_IOC_OBJ_TO_PATH,
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   423
	ZFS_IOC_POOL_SET_PROPS,
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   424
	ZFS_IOC_POOL_GET_PROPS
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   425
} zfs_ioc_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   426
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   427
/*
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   428
 * Internal SPA load state.  Used by FMA diagnosis engine.
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   429
 */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   430
typedef enum {
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   431
	SPA_LOAD_NONE,		/* no load in progress */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   432
	SPA_LOAD_OPEN,		/* normal open */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   433
	SPA_LOAD_IMPORT,	/* import in progress */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   434
	SPA_LOAD_TRYIMPORT	/* tryimport in progress */
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   435
} spa_load_state_t;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1485
diff changeset
   436
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
   437
/*
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
   438
 * Bookmark name values.
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
   439
 */
3444
dc160a70a50d 6410433 'zpool status -v' would be more useful with filenames
ek110237
parents: 3377
diff changeset
   440
#define	ZPOOL_ERR_LIST		"error list"
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
   441
#define	ZPOOL_ERR_DATASET	"dataset"
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
   442
#define	ZPOOL_ERR_OBJECT	"object"
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2199
diff changeset
   443
2926
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   444
#define	HIS_MAX_RECORD_LEN	(MAXPATHLEN + MAXPATHLEN + 1)
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   445
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   446
/*
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   447
 * The following are names used in the nvlist describing
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   448
 * the pool's history log.
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   449
 */
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   450
#define	ZPOOL_HIST_RECORD	"history record"
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   451
#define	ZPOOL_HIST_TIME		"history time"
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   452
#define	ZPOOL_HIST_CMD		"history command"
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2717
diff changeset
   453
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   454
/*
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   455
 * Flags for ZFS_IOC_VDEV_SET_STATE
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   456
 */
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   457
#define	ZFS_ONLINE_CHECKREMOVE	0x1
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   458
#define	ZFS_ONLINE_UNSPARE	0x2
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   459
#define	ZFS_ONLINE_FORCEFAULT	0x4
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   460
#define	ZFS_OFFLINE_TEMPORARY	0x1
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   461
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   462
/*
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   463
 * Sysevent payload members.  ZFS will generate the following sysevents with the
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   464
 * given payloads:
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   465
 *
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   466
 *	ESC_ZFS_RESILVER_START
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   467
 *	ESC_ZFS_RESILVER_END
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   468
 *	ESC_ZFS_POOL_DESTROY
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   469
 *
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   470
 *		ZFS_EV_POOL_NAME	DATA_TYPE_STRING
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   471
 *		ZFS_EV_POOL_GUID	DATA_TYPE_UINT64
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   472
 *
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   473
 *	ESC_ZFS_VDEV_REMOVE
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   474
 *	ESC_ZFS_VDEV_CLEAR
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   475
 *	ESC_ZFS_VDEV_CHECK
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   476
 *
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   477
 *		ZFS_EV_POOL_NAME	DATA_TYPE_STRING
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   478
 *		ZFS_EV_POOL_GUID	DATA_TYPE_UINT64
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   479
 *		ZFS_EV_VDEV_PATH	DATA_TYPE_STRING	(optional)
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   480
 *		ZFS_EV_VDEV_GUID	DATA_TYPE_UINT64
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   481
 */
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   482
#define	ZFS_EV_POOL_NAME	"pool_name"
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   483
#define	ZFS_EV_POOL_GUID	"pool_guid"
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   484
#define	ZFS_EV_VDEV_PATH	"vdev_path"
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   485
#define	ZFS_EV_VDEV_GUID	"vdev_guid"
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3975
diff changeset
   486
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   487
#ifdef	__cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   488
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   489
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   490
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   491
#endif	/* _SYS_FS_ZFS_H */