author | Christopher Siden <chris.siden@delphix.com> |
Mon, 21 May 2012 12:11:39 -0700 | |
changeset 13700 | 2889e2596bd6 |
parent 13414 | b42c1f0432b6 |
child 13869 | 921a99998bb4 |
permissions | -rw-r--r-- |
789 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
1544 | 5 |
* Common Development and Distribution License (the "License"). |
6 |
* You may not use this file except in compliance with the License. |
|
789 | 7 |
* |
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
* or http://www.opensolaris.org/os/licensing. |
|
10 |
* See the License for the specific language governing permissions |
|
11 |
* and limitations under the License. |
|
12 |
* |
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
* |
|
19 |
* CDDL HEADER END |
|
20 |
*/ |
|
3886
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
21 |
|
789 | 22 |
/* |
12450
c77e20e4e046
6938089 dedup-induced latency causes FC initiator logouts/FC port resets
George Wilson <George.Wilson@Sun.COM>
parents:
11670
diff
changeset
|
23 |
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
789 | 24 |
*/ |
13414
b42c1f0432b6
734 taskq_dispatch_prealloc() desired
Garrett D'Amore <garrett@nexenta.com>
parents:
12586
diff
changeset
|
25 |
/* |
b42c1f0432b6
734 taskq_dispatch_prealloc() desired
Garrett D'Amore <garrett@nexenta.com>
parents:
12586
diff
changeset
|
26 |
* Copyright 2011 Nexenta Systems, Inc. All rights reserved. |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
27 |
* Copyright (c) 2012 by Delphix. All rights reserved. |
13414
b42c1f0432b6
734 taskq_dispatch_prealloc() desired
Garrett D'Amore <garrett@nexenta.com>
parents:
12586
diff
changeset
|
28 |
*/ |
789 | 29 |
|
30 |
#ifndef _ZIO_H |
|
31 |
#define _ZIO_H |
|
32 |
||
33 |
#include <sys/zfs_context.h> |
|
34 |
#include <sys/spa.h> |
|
35 |
#include <sys/txg.h> |
|
36 |
#include <sys/avl.h> |
|
37 |
#include <sys/fs/zfs.h> |
|
1775
e51e26b432c0
6410698 ZFS metadata needs to be more highly replicated (ditto blocks)
billm
parents:
1732
diff
changeset
|
38 |
#include <sys/zio_impl.h> |
789 | 39 |
|
40 |
#ifdef __cplusplus |
|
41 |
extern "C" { |
|
42 |
#endif |
|
43 |
||
11670
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
44 |
/* |
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
45 |
* Embedded checksum |
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
46 |
*/ |
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
47 |
#define ZEC_MAGIC 0x210da7ab10c7a11ULL |
789 | 48 |
|
11670
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
49 |
typedef struct zio_eck { |
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
50 |
uint64_t zec_magic; /* for validation, endianness */ |
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
51 |
zio_cksum_t zec_cksum; /* 256-bit checksum */ |
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
52 |
} zio_eck_t; |
789 | 53 |
|
54 |
/* |
|
55 |
* Gang block headers are self-checksumming and contain an array |
|
56 |
* of block pointers. |
|
57 |
*/ |
|
58 |
#define SPA_GANGBLOCKSIZE SPA_MINBLOCKSIZE |
|
59 |
#define SPA_GBH_NBLKPTRS ((SPA_GANGBLOCKSIZE - \ |
|
11670
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
60 |
sizeof (zio_eck_t)) / sizeof (blkptr_t)) |
789 | 61 |
#define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \ |
11670
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
62 |
sizeof (zio_eck_t) - \ |
789 | 63 |
(SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\ |
64 |
sizeof (uint64_t)) |
|
65 |
||
66 |
typedef struct zio_gbh { |
|
67 |
blkptr_t zg_blkptr[SPA_GBH_NBLKPTRS]; |
|
68 |
uint64_t zg_filler[SPA_GBH_FILLER]; |
|
11670
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
69 |
zio_eck_t zg_tail; |
789 | 70 |
} zio_gbh_phys_t; |
71 |
||
72 |
enum zio_checksum { |
|
73 |
ZIO_CHECKSUM_INHERIT = 0, |
|
74 |
ZIO_CHECKSUM_ON, |
|
75 |
ZIO_CHECKSUM_OFF, |
|
76 |
ZIO_CHECKSUM_LABEL, |
|
77 |
ZIO_CHECKSUM_GANG_HEADER, |
|
78 |
ZIO_CHECKSUM_ZILOG, |
|
79 |
ZIO_CHECKSUM_FLETCHER_2, |
|
80 |
ZIO_CHECKSUM_FLETCHER_4, |
|
81 |
ZIO_CHECKSUM_SHA256, |
|
11670
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
82 |
ZIO_CHECKSUM_ZILOG2, |
789 | 83 |
ZIO_CHECKSUM_FUNCTIONS |
84 |
}; |
|
85 |
||
9454
02e1ddcc9be7
6740597 zfs fletcher-2 is losing its carries
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
9443
diff
changeset
|
86 |
#define ZIO_CHECKSUM_ON_VALUE ZIO_CHECKSUM_FLETCHER_4 |
789 | 87 |
#define ZIO_CHECKSUM_DEFAULT ZIO_CHECKSUM_ON |
88 |
||
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
89 |
#define ZIO_CHECKSUM_MASK 0xffULL |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
90 |
#define ZIO_CHECKSUM_VERIFY (1 << 8) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
91 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
92 |
#define ZIO_DEDUPCHECKSUM ZIO_CHECKSUM_SHA256 |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
93 |
#define ZIO_DEDUPDITTO_MIN 100 |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
94 |
|
789 | 95 |
enum zio_compress { |
96 |
ZIO_COMPRESS_INHERIT = 0, |
|
97 |
ZIO_COMPRESS_ON, |
|
98 |
ZIO_COMPRESS_OFF, |
|
99 |
ZIO_COMPRESS_LZJB, |
|
2986 | 100 |
ZIO_COMPRESS_EMPTY, |
3886
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
101 |
ZIO_COMPRESS_GZIP_1, |
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
102 |
ZIO_COMPRESS_GZIP_2, |
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
103 |
ZIO_COMPRESS_GZIP_3, |
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
104 |
ZIO_COMPRESS_GZIP_4, |
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
105 |
ZIO_COMPRESS_GZIP_5, |
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
106 |
ZIO_COMPRESS_GZIP_6, |
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
107 |
ZIO_COMPRESS_GZIP_7, |
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
108 |
ZIO_COMPRESS_GZIP_8, |
3291401d66a6
6536602 add zlib compression support and upgrade to version 1.2.3
ahl
parents:
3689
diff
changeset
|
109 |
ZIO_COMPRESS_GZIP_9, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
110 |
ZIO_COMPRESS_ZLE, |
789 | 111 |
ZIO_COMPRESS_FUNCTIONS |
112 |
}; |
|
113 |
||
114 |
#define ZIO_COMPRESS_ON_VALUE ZIO_COMPRESS_LZJB |
|
115 |
#define ZIO_COMPRESS_DEFAULT ZIO_COMPRESS_OFF |
|
116 |
||
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
117 |
#define BOOTFS_COMPRESS_VALID(compress) \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
118 |
((compress) == ZIO_COMPRESS_LZJB || \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
119 |
((compress) == ZIO_COMPRESS_ON && \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
120 |
ZIO_COMPRESS_ON_VALUE == ZIO_COMPRESS_LZJB) || \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
121 |
(compress) == ZIO_COMPRESS_OFF) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
122 |
|
5329 | 123 |
#define ZIO_FAILURE_MODE_WAIT 0 |
124 |
#define ZIO_FAILURE_MODE_CONTINUE 1 |
|
125 |
#define ZIO_FAILURE_MODE_PANIC 2 |
|
126 |
||
789 | 127 |
#define ZIO_PRIORITY_NOW (zio_priority_table[0]) |
128 |
#define ZIO_PRIORITY_SYNC_READ (zio_priority_table[1]) |
|
129 |
#define ZIO_PRIORITY_SYNC_WRITE (zio_priority_table[2]) |
|
11146
7e58f40bcb1c
6826241 Sync write IOPS drops dramatically during TXG sync
George Wilson <George.Wilson@Sun.COM>
parents:
10922
diff
changeset
|
130 |
#define ZIO_PRIORITY_LOG_WRITE (zio_priority_table[3]) |
7e58f40bcb1c
6826241 Sync write IOPS drops dramatically during TXG sync
George Wilson <George.Wilson@Sun.COM>
parents:
10922
diff
changeset
|
131 |
#define ZIO_PRIORITY_CACHE_FILL (zio_priority_table[4]) |
7e58f40bcb1c
6826241 Sync write IOPS drops dramatically during TXG sync
George Wilson <George.Wilson@Sun.COM>
parents:
10922
diff
changeset
|
132 |
#define ZIO_PRIORITY_AGG (zio_priority_table[5]) |
7e58f40bcb1c
6826241 Sync write IOPS drops dramatically during TXG sync
George Wilson <George.Wilson@Sun.COM>
parents:
10922
diff
changeset
|
133 |
#define ZIO_PRIORITY_FREE (zio_priority_table[6]) |
7e58f40bcb1c
6826241 Sync write IOPS drops dramatically during TXG sync
George Wilson <George.Wilson@Sun.COM>
parents:
10922
diff
changeset
|
134 |
#define ZIO_PRIORITY_ASYNC_WRITE (zio_priority_table[7]) |
7e58f40bcb1c
6826241 Sync write IOPS drops dramatically during TXG sync
George Wilson <George.Wilson@Sun.COM>
parents:
10922
diff
changeset
|
135 |
#define ZIO_PRIORITY_ASYNC_READ (zio_priority_table[8]) |
7e58f40bcb1c
6826241 Sync write IOPS drops dramatically during TXG sync
George Wilson <George.Wilson@Sun.COM>
parents:
10922
diff
changeset
|
136 |
#define ZIO_PRIORITY_RESILVER (zio_priority_table[9]) |
7e58f40bcb1c
6826241 Sync write IOPS drops dramatically during TXG sync
George Wilson <George.Wilson@Sun.COM>
parents:
10922
diff
changeset
|
137 |
#define ZIO_PRIORITY_SCRUB (zio_priority_table[10]) |
12450
c77e20e4e046
6938089 dedup-induced latency causes FC initiator logouts/FC port resets
George Wilson <George.Wilson@Sun.COM>
parents:
11670
diff
changeset
|
138 |
#define ZIO_PRIORITY_DDT_PREFETCH (zio_priority_table[11]) |
c77e20e4e046
6938089 dedup-induced latency causes FC initiator logouts/FC port resets
George Wilson <George.Wilson@Sun.COM>
parents:
11670
diff
changeset
|
139 |
#define ZIO_PRIORITY_TABLE_SIZE 12 |
789 | 140 |
|
5530 | 141 |
#define ZIO_PIPELINE_CONTINUE 0x100 |
142 |
#define ZIO_PIPELINE_STOP 0x101 |
|
143 |
||
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
144 |
enum zio_flag { |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
145 |
/* |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
146 |
* Flags inherited by gang, ddt, and vdev children, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
147 |
* and that must be equal for two zios to aggregate |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
148 |
*/ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
149 |
ZIO_FLAG_DONT_AGGREGATE = 1 << 0, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
150 |
ZIO_FLAG_IO_REPAIR = 1 << 1, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
151 |
ZIO_FLAG_SELF_HEAL = 1 << 2, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
152 |
ZIO_FLAG_RESILVER = 1 << 3, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
153 |
ZIO_FLAG_SCRUB = 1 << 4, |
12586
b118bbd65be9
6494473 ZFS needs a way to slow down resilvering
George Wilson <George.Wilson@Sun.COM>
parents:
12450
diff
changeset
|
154 |
ZIO_FLAG_SCAN_THREAD = 1 << 5, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
155 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
156 |
#define ZIO_FLAG_AGG_INHERIT (ZIO_FLAG_CANFAIL - 1) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
157 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
158 |
/* |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
159 |
* Flags inherited by ddt, gang, and vdev children. |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
160 |
*/ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
161 |
ZIO_FLAG_CANFAIL = 1 << 6, /* must be first for INHERIT */ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
162 |
ZIO_FLAG_SPECULATIVE = 1 << 7, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
163 |
ZIO_FLAG_CONFIG_WRITER = 1 << 8, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
164 |
ZIO_FLAG_DONT_RETRY = 1 << 9, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
165 |
ZIO_FLAG_DONT_CACHE = 1 << 10, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
166 |
ZIO_FLAG_NODATA = 1 << 11, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
167 |
ZIO_FLAG_INDUCE_DAMAGE = 1 << 12, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
168 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
169 |
#define ZIO_FLAG_DDT_INHERIT (ZIO_FLAG_IO_RETRY - 1) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
170 |
#define ZIO_FLAG_GANG_INHERIT (ZIO_FLAG_IO_RETRY - 1) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
171 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
172 |
/* |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
173 |
* Flags inherited by vdev children. |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
174 |
*/ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
175 |
ZIO_FLAG_IO_RETRY = 1 << 13, /* must be first for INHERIT */ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
176 |
ZIO_FLAG_PROBE = 1 << 14, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
177 |
ZIO_FLAG_TRYHARD = 1 << 15, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
178 |
ZIO_FLAG_OPTIONAL = 1 << 16, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
179 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
180 |
#define ZIO_FLAG_VDEV_INHERIT (ZIO_FLAG_DONT_QUEUE - 1) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
181 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
182 |
/* |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
183 |
* Flags not inherited by any children. |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
184 |
*/ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
185 |
ZIO_FLAG_DONT_QUEUE = 1 << 17, /* must be first for INHERIT */ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
186 |
ZIO_FLAG_DONT_PROPAGATE = 1 << 18, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
187 |
ZIO_FLAG_IO_BYPASS = 1 << 19, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
188 |
ZIO_FLAG_IO_REWRITE = 1 << 20, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
189 |
ZIO_FLAG_RAW = 1 << 21, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
190 |
ZIO_FLAG_GANG_CHILD = 1 << 22, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
191 |
ZIO_FLAG_DDT_CHILD = 1 << 23, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
192 |
ZIO_FLAG_GODFATHER = 1 << 24 |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
193 |
}; |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
194 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
195 |
#define ZIO_FLAG_MUSTSUCCEED 0 |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
196 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
197 |
#define ZIO_DDT_CHILD_FLAGS(zio) \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
198 |
(((zio)->io_flags & ZIO_FLAG_DDT_INHERIT) | \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
199 |
ZIO_FLAG_DDT_CHILD | ZIO_FLAG_CANFAIL) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
200 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
201 |
#define ZIO_GANG_CHILD_FLAGS(zio) \ |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
202 |
(((zio)->io_flags & ZIO_FLAG_GANG_INHERIT) | \ |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
203 |
ZIO_FLAG_GANG_CHILD | ZIO_FLAG_CANFAIL) |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
204 |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
205 |
#define ZIO_VDEV_CHILD_FLAGS(zio) \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
206 |
(((zio)->io_flags & ZIO_FLAG_VDEV_INHERIT) | \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
207 |
ZIO_FLAG_CANFAIL) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
208 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
209 |
enum zio_child { |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
210 |
ZIO_CHILD_VDEV = 0, |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
211 |
ZIO_CHILD_GANG, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
212 |
ZIO_CHILD_DDT, |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
213 |
ZIO_CHILD_LOGICAL, |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
214 |
ZIO_CHILD_TYPES |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
215 |
}; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
216 |
|
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
217 |
enum zio_wait_type { |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
218 |
ZIO_WAIT_READY = 0, |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
219 |
ZIO_WAIT_DONE, |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
220 |
ZIO_WAIT_TYPES |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
221 |
}; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
222 |
|
789 | 223 |
/* |
6423 | 224 |
* We'll take the unused errnos, 'EBADE' and 'EBADR' (from the Convergent |
225 |
* graveyard) to indicate checksum errors and fragmentation. |
|
789 | 226 |
*/ |
227 |
#define ECKSUM EBADE |
|
6423 | 228 |
#define EFRAGS EBADR |
789 | 229 |
|
230 |
typedef void zio_done_func_t(zio_t *zio); |
|
231 |
||
232 |
extern uint8_t zio_priority_table[ZIO_PRIORITY_TABLE_SIZE]; |
|
233 |
extern char *zio_type_name[ZIO_TYPES]; |
|
234 |
||
1544 | 235 |
/* |
236 |
* A bookmark is a four-tuple <objset, object, level, blkid> that uniquely |
|
237 |
* identifies any block in the pool. By convention, the meta-objset (MOS) |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
238 |
* is objset 0, and the meta-dnode is object 0. This covers all blocks |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
239 |
* except root blocks and ZIL blocks, which are defined as follows: |
1544 | 240 |
* |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
241 |
* Root blocks (objset_phys_t) are object 0, level -1: <objset, 0, -1, 0>. |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
242 |
* ZIL blocks are bookmarked <objset, 0, -2, blkid == ZIL sequence number>. |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
243 |
* dmu_sync()ed ZIL data blocks are bookmarked <objset, object, -2, blkid>. |
1544 | 244 |
* |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
245 |
* Note: this structure is called a bookmark because its original purpose |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
246 |
* was to remember where to resume a pool-wide traverse. |
1544 | 247 |
* |
248 |
* Note: this structure is passed between userland and the kernel. |
|
249 |
* Therefore it must not change size or alignment between 32/64 bit |
|
250 |
* compilation options. |
|
251 |
*/ |
|
252 |
typedef struct zbookmark { |
|
253 |
uint64_t zb_objset; |
|
254 |
uint64_t zb_object; |
|
255 |
int64_t zb_level; |
|
256 |
uint64_t zb_blkid; |
|
257 |
} zbookmark_t; |
|
258 |
||
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
259 |
#define SET_BOOKMARK(zb, objset, object, level, blkid) \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
260 |
{ \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
261 |
(zb)->zb_objset = objset; \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
262 |
(zb)->zb_object = object; \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
263 |
(zb)->zb_level = level; \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
264 |
(zb)->zb_blkid = blkid; \ |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
265 |
} |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
266 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
267 |
#define ZB_DESTROYED_OBJSET (-1ULL) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
268 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
269 |
#define ZB_ROOT_OBJECT (0ULL) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
270 |
#define ZB_ROOT_LEVEL (-1LL) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
271 |
#define ZB_ROOT_BLKID (0ULL) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
272 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
273 |
#define ZB_ZIL_OBJECT (0ULL) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
274 |
#define ZB_ZIL_LEVEL (-2LL) |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
275 |
|
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
276 |
#define ZB_IS_ZERO(zb) \ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
277 |
((zb)->zb_objset == 0 && (zb)->zb_object == 0 && \ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
278 |
(zb)->zb_level == 0 && (zb)->zb_blkid == 0) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
279 |
#define ZB_IS_ROOT(zb) \ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
280 |
((zb)->zb_object == ZB_ROOT_OBJECT && \ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
281 |
(zb)->zb_level == ZB_ROOT_LEVEL && \ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
282 |
(zb)->zb_blkid == ZB_ROOT_BLKID) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
283 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
284 |
typedef struct zio_prop { |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
285 |
enum zio_checksum zp_checksum; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
286 |
enum zio_compress zp_compress; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
287 |
dmu_object_type_t zp_type; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
288 |
uint8_t zp_level; |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
289 |
uint8_t zp_copies; |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
290 |
uint8_t zp_dedup; |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
291 |
uint8_t zp_dedup_verify; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
292 |
} zio_prop_t; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
293 |
|
10614
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
294 |
typedef struct zio_cksum_report zio_cksum_report_t; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
295 |
|
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
296 |
typedef void zio_cksum_finish_f(zio_cksum_report_t *rep, |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
297 |
const void *good_data); |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
298 |
typedef void zio_cksum_free_f(void *cbdata, size_t size); |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
299 |
|
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
300 |
struct zio_bad_cksum; /* defined in zio_checksum.h */ |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
301 |
struct dnode_phys; |
10614
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
302 |
|
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
303 |
struct zio_cksum_report { |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
304 |
struct zio_cksum_report *zcr_next; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
305 |
nvlist_t *zcr_ereport; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
306 |
nvlist_t *zcr_detector; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
307 |
void *zcr_cbdata; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
308 |
size_t zcr_cbinfo; /* passed to zcr_free() */ |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
309 |
uint64_t zcr_align; |
10614
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
310 |
uint64_t zcr_length; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
311 |
zio_cksum_finish_f *zcr_finish; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
312 |
zio_cksum_free_f *zcr_free; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
313 |
|
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
314 |
/* internal use only */ |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
315 |
struct zio_bad_cksum *zcr_ckinfo; /* information from failure */ |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
316 |
}; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
317 |
|
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
318 |
typedef void zio_vsd_cksum_report_f(zio_t *zio, zio_cksum_report_t *zcr, |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
319 |
void *arg); |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
320 |
|
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
321 |
zio_vsd_cksum_report_f zio_vsd_default_cksum_report; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
322 |
|
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
323 |
typedef struct zio_vsd_ops { |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
324 |
zio_done_func_t *vsd_free; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
325 |
zio_vsd_cksum_report_f *vsd_cksum_report; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
326 |
} zio_vsd_ops_t; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
327 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
328 |
typedef struct zio_gang_node { |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
329 |
zio_gbh_phys_t *gn_gbh; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
330 |
struct zio_gang_node *gn_child[SPA_GBH_NBLKPTRS]; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
331 |
} zio_gang_node_t; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
332 |
|
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
333 |
typedef zio_t *zio_gang_issue_func_t(zio_t *zio, blkptr_t *bp, |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
334 |
zio_gang_node_t *gn, void *data); |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
335 |
|
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
336 |
typedef void zio_transform_func_t(zio_t *zio, void *data, uint64_t size); |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
337 |
|
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
338 |
typedef struct zio_transform { |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
339 |
void *zt_orig_data; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
340 |
uint64_t zt_orig_size; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
341 |
uint64_t zt_bufsize; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
342 |
zio_transform_func_t *zt_transform; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
343 |
struct zio_transform *zt_next; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
344 |
} zio_transform_t; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
345 |
|
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
346 |
typedef int zio_pipe_stage_t(zio_t *zio); |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
347 |
|
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
348 |
/* |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
349 |
* The io_reexecute flags are distinct from io_flags because the child must |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
350 |
* be able to propagate them to the parent. The normal io_flags are local |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
351 |
* to the zio, not protected by any lock, and not modifiable by children; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
352 |
* the reexecute flags are protected by io_lock, modifiable by children, |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
353 |
* and always propagated -- even when ZIO_FLAG_DONT_PROPAGATE is set. |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
354 |
*/ |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
355 |
#define ZIO_REEXECUTE_NOW 0x01 |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
356 |
#define ZIO_REEXECUTE_SUSPEND 0x02 |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
357 |
|
8632
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
358 |
typedef struct zio_link { |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
359 |
zio_t *zl_parent; |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
360 |
zio_t *zl_child; |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
361 |
list_node_t zl_parent_node; |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
362 |
list_node_t zl_child_node; |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
363 |
} zio_link_t; |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
364 |
|
789 | 365 |
struct zio { |
366 |
/* Core information about this I/O */ |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
367 |
zbookmark_t io_bookmark; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
368 |
zio_prop_t io_prop; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
369 |
zio_type_t io_type; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
370 |
enum zio_child io_child_type; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
371 |
int io_cmd; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
372 |
uint8_t io_priority; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
373 |
uint8_t io_reexecute; |
8632
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
374 |
uint8_t io_state[ZIO_WAIT_TYPES]; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
375 |
uint64_t io_txg; |
789 | 376 |
spa_t *io_spa; |
377 |
blkptr_t *io_bp; |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
378 |
blkptr_t *io_bp_override; |
789 | 379 |
blkptr_t io_bp_copy; |
8632
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
380 |
list_t io_parent_list; |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
381 |
list_t io_child_list; |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
382 |
zio_link_t *io_walk_link; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
383 |
zio_t *io_logical; |
789 | 384 |
zio_transform_t *io_transform_stack; |
385 |
||
386 |
/* Callback info */ |
|
3547
e396e0a440b1
6512391 DMU should leverage ZIO dependencies to achieve greater parallelism
maybee
parents:
3463
diff
changeset
|
387 |
zio_done_func_t *io_ready; |
789 | 388 |
zio_done_func_t *io_done; |
389 |
void *io_private; |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
390 |
int64_t io_prev_space_delta; /* DMU private */ |
789 | 391 |
blkptr_t io_bp_orig; |
392 |
||
393 |
/* Data represented by this I/O */ |
|
394 |
void *io_data; |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
395 |
void *io_orig_data; |
789 | 396 |
uint64_t io_size; |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
397 |
uint64_t io_orig_size; |
789 | 398 |
|
399 |
/* Stuff for the vdev stack */ |
|
400 |
vdev_t *io_vd; |
|
401 |
void *io_vsd; |
|
10614
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
402 |
const zio_vsd_ops_t *io_vsd_ops; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
403 |
|
789 | 404 |
uint64_t io_offset; |
405 |
uint64_t io_deadline; |
|
406 |
avl_node_t io_offset_node; |
|
407 |
avl_node_t io_deadline_node; |
|
408 |
avl_tree_t *io_vdev_tree; |
|
409 |
||
410 |
/* Internal pipeline state */ |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
411 |
enum zio_flag io_flags; |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
412 |
enum zio_stage io_stage; |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
413 |
enum zio_stage io_pipeline; |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
414 |
enum zio_flag io_orig_flags; |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
415 |
enum zio_stage io_orig_stage; |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
416 |
enum zio_stage io_orig_pipeline; |
789 | 417 |
int io_error; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
418 |
int io_child_error[ZIO_CHILD_TYPES]; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
419 |
uint64_t io_children[ZIO_CHILD_TYPES][ZIO_WAIT_TYPES]; |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
420 |
uint64_t io_child_count; |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
421 |
uint64_t io_parent_count; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
422 |
uint64_t *io_stall; |
9443
2a96d8478e95
6833711 gang leaders shouldn't have to be logical
Bill Moore <Bill.Moore@Sun.COM>
parents:
9234
diff
changeset
|
423 |
zio_t *io_gang_leader; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
424 |
zio_gang_node_t *io_gang_tree; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
425 |
void *io_executor; |
789 | 426 |
void *io_waiter; |
427 |
kmutex_t io_lock; |
|
428 |
kcondvar_t io_cv; |
|
1544 | 429 |
|
430 |
/* FMA state */ |
|
10614
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
431 |
zio_cksum_report_t *io_cksum_report; |
1544 | 432 |
uint64_t io_ena; |
13414
b42c1f0432b6
734 taskq_dispatch_prealloc() desired
Garrett D'Amore <garrett@nexenta.com>
parents:
12586
diff
changeset
|
433 |
|
b42c1f0432b6
734 taskq_dispatch_prealloc() desired
Garrett D'Amore <garrett@nexenta.com>
parents:
12586
diff
changeset
|
434 |
/* Taskq dispatching state */ |
b42c1f0432b6
734 taskq_dispatch_prealloc() desired
Garrett D'Amore <garrett@nexenta.com>
parents:
12586
diff
changeset
|
435 |
taskq_ent_t io_tqent; |
789 | 436 |
}; |
437 |
||
8632
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
438 |
extern zio_t *zio_null(zio_t *pio, spa_t *spa, vdev_t *vd, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
439 |
zio_done_func_t *done, void *private, enum zio_flag flags); |
789 | 440 |
|
441 |
extern zio_t *zio_root(spa_t *spa, |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
442 |
zio_done_func_t *done, void *private, enum zio_flag flags); |
789 | 443 |
|
7046
361307ae060d
6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents:
7030
diff
changeset
|
444 |
extern zio_t *zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data, |
789 | 445 |
uint64_t size, zio_done_func_t *done, void *private, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
446 |
int priority, enum zio_flag flags, const zbookmark_t *zb); |
789 | 447 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
448 |
extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
449 |
void *data, uint64_t size, const zio_prop_t *zp, |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
450 |
zio_done_func_t *ready, zio_done_func_t *done, void *private, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
451 |
int priority, enum zio_flag flags, const zbookmark_t *zb); |
789 | 452 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
453 |
extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
454 |
void *data, uint64_t size, zio_done_func_t *done, void *private, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
455 |
int priority, enum zio_flag flags, zbookmark_t *zb); |
789 | 456 |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
457 |
extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies); |
7872
40a9434212f6
6646775 Speed up the dumpifying process for zvols
Tim Haley <Tim.Haley@Sun.COM>
parents:
7754
diff
changeset
|
458 |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
459 |
extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp); |
789 | 460 |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
461 |
extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
462 |
const blkptr_t *bp, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
463 |
zio_done_func_t *done, void *private, enum zio_flag flags); |
789 | 464 |
|
465 |
extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd, |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
466 |
zio_done_func_t *done, void *private, int priority, enum zio_flag flags); |
789 | 467 |
|
468 |
extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset, |
|
469 |
uint64_t size, void *data, int checksum, |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
470 |
zio_done_func_t *done, void *private, int priority, enum zio_flag flags, |
5450 | 471 |
boolean_t labels); |
789 | 472 |
|
473 |
extern zio_t *zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset, |
|
474 |
uint64_t size, void *data, int checksum, |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
475 |
zio_done_func_t *done, void *private, int priority, enum zio_flag flags, |
5450 | 476 |
boolean_t labels); |
789 | 477 |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
478 |
extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
479 |
const blkptr_t *bp, enum zio_flag flags); |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
480 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
481 |
extern int zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
482 |
blkptr_t *old_bp, uint64_t size, boolean_t use_slog); |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
483 |
extern void zio_free_zil(spa_t *spa, uint64_t txg, blkptr_t *bp); |
5688
c0b02c8fd2c0
6640580 spa_get_random() is insanely slow in userland
bonwick
parents:
5530
diff
changeset
|
484 |
extern void zio_flush(zio_t *zio, vdev_t *vd); |
11670
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11422
diff
changeset
|
485 |
extern void zio_shrink(zio_t *zio, uint64_t size); |
789 | 486 |
|
487 |
extern int zio_wait(zio_t *zio); |
|
488 |
extern void zio_nowait(zio_t *zio); |
|
5530 | 489 |
extern void zio_execute(zio_t *zio); |
490 |
extern void zio_interrupt(zio_t *zio); |
|
491 |
||
8632
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
492 |
extern zio_t *zio_walk_parents(zio_t *cio); |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
493 |
extern zio_t *zio_walk_children(zio_t *pio); |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
494 |
extern zio_t *zio_unique_parent(zio_t *cio); |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
495 |
extern void zio_add_child(zio_t *pio, zio_t *cio); |
36ef517870a3
6798384 It can take a village to raise a zio
Bill Moore <Bill.Moore@Sun.COM>
parents:
8274
diff
changeset
|
496 |
|
789 | 497 |
extern void *zio_buf_alloc(size_t size); |
498 |
extern void zio_buf_free(void *buf, size_t size); |
|
3290 | 499 |
extern void *zio_data_buf_alloc(size_t size); |
500 |
extern void zio_data_buf_free(void *buf, size_t size); |
|
789 | 501 |
|
5329 | 502 |
extern void zio_resubmit_stage_async(void *); |
789 | 503 |
|
504 |
extern zio_t *zio_vdev_child_io(zio_t *zio, blkptr_t *bp, vdev_t *vd, |
|
505 |
uint64_t offset, void *data, uint64_t size, int type, int priority, |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
506 |
enum zio_flag flags, zio_done_func_t *done, void *private); |
789 | 507 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
508 |
extern zio_t *zio_vdev_delegated_io(vdev_t *vd, uint64_t offset, |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
509 |
void *data, uint64_t size, int type, int priority, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
510 |
enum zio_flag flags, zio_done_func_t *done, void *private); |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
511 |
|
789 | 512 |
extern void zio_vdev_io_bypass(zio_t *zio); |
513 |
extern void zio_vdev_io_reissue(zio_t *zio); |
|
514 |
extern void zio_vdev_io_redone(zio_t *zio); |
|
515 |
||
516 |
extern void zio_checksum_verified(zio_t *zio); |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
517 |
extern int zio_worst_error(int e1, int e2); |
789 | 518 |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
519 |
extern enum zio_checksum zio_checksum_select(enum zio_checksum child, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
520 |
enum zio_checksum parent); |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
521 |
extern enum zio_checksum zio_checksum_dedup_select(spa_t *spa, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
522 |
enum zio_checksum child, enum zio_checksum parent); |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
523 |
extern enum zio_compress zio_compress_select(enum zio_compress child, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
524 |
enum zio_compress parent); |
789 | 525 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
526 |
extern void zio_suspend(spa_t *spa, zio_t *zio); |
9234
bffdc4fc05c4
6792139 recovering from a suspended pool needs some work
George Wilson <George.Wilson@Sun.COM>
parents:
8632
diff
changeset
|
527 |
extern int zio_resume(spa_t *spa); |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7181
diff
changeset
|
528 |
extern void zio_resume_wait(spa_t *spa); |
1544 | 529 |
|
789 | 530 |
/* |
531 |
* Initial setup and teardown. |
|
532 |
*/ |
|
533 |
extern void zio_init(void); |
|
534 |
extern void zio_fini(void); |
|
535 |
||
1544 | 536 |
/* |
537 |
* Fault injection |
|
538 |
*/ |
|
539 |
struct zinject_record; |
|
540 |
extern uint32_t zio_injection_enabled; |
|
541 |
extern int zio_inject_fault(char *name, int flags, int *id, |
|
542 |
struct zinject_record *record); |
|
543 |
extern int zio_inject_list_next(int *id, char *name, size_t buflen, |
|
544 |
struct zinject_record *record); |
|
545 |
extern int zio_clear_fault(int id); |
|
11422
42768837421d
PSARC/2009/511 zpool split
Mark J Musante <Mark.Musante@Sun.COM>
parents:
11146
diff
changeset
|
546 |
extern void zio_handle_panic_injection(spa_t *spa, char *tag, uint64_t type); |
1544 | 547 |
extern int zio_handle_fault_injection(zio_t *zio, int error); |
9725
0bf7402e8022
6843014 ZFS B_FAILFAST handling is broken
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9454
diff
changeset
|
548 |
extern int zio_handle_device_injection(vdev_t *vd, zio_t *zio, int error); |
6615
333cfc13ec55
6616599 vdev_config_sync(rvd, txg) == 0, file: ../../common/fs/zfs/spa .c, line: 3537
gw25295
parents:
6523
diff
changeset
|
549 |
extern int zio_handle_label_injection(zio_t *zio, int error); |
10921
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
10879
diff
changeset
|
550 |
extern void zio_handle_ignored_writes(zio_t *zio); |
1544 | 551 |
|
10614
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
552 |
/* |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
553 |
* Checksum ereport functions |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
554 |
*/ |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
555 |
extern void zfs_ereport_start_checksum(spa_t *spa, vdev_t *vd, struct zio *zio, |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
556 |
uint64_t offset, uint64_t length, void *arg, struct zio_bad_cksum *info); |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
557 |
extern void zfs_ereport_finish_checksum(zio_cksum_report_t *report, |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
558 |
const void *good_data, const void *bad_data, boolean_t drop_if_identical); |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
559 |
|
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
560 |
extern void zfs_ereport_send_interim_checksum(zio_cksum_report_t *report); |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
561 |
extern void zfs_ereport_free_checksum(zio_cksum_report_t *report); |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
562 |
|
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
563 |
/* If we have the good data in hand, this function can be used */ |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
564 |
extern void zfs_ereport_post_checksum(spa_t *spa, vdev_t *vd, |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
565 |
struct zio *zio, uint64_t offset, uint64_t length, |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
566 |
const void *good_data, const void *bad_data, struct zio_bad_cksum *info); |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10594
diff
changeset
|
567 |
|
10921
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
10879
diff
changeset
|
568 |
/* Called from spa_sync(), but primarily an injection handler */ |
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
10879
diff
changeset
|
569 |
extern void spa_handle_ignored_writes(spa_t *spa); |
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
10879
diff
changeset
|
570 |
|
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
571 |
/* zbookmark functions */ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
572 |
boolean_t zbookmark_is_before(const struct dnode_phys *dnp, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
573 |
const zbookmark_t *zb1, const zbookmark_t *zb2); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13414
diff
changeset
|
574 |
|
789 | 575 |
#ifdef __cplusplus |
576 |
} |
|
577 |
#endif |
|
578 |
||
579 |
#endif /* _ZIO_H */ |