4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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.
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]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 #include <sys/zfs_context.h>
37 * zio pipeline stage definitions
40 ZIO_STAGE_OPEN = 1 << 0, /* RWFCI */
42 ZIO_STAGE_READ_BP_INIT = 1 << 1, /* R---- */
43 ZIO_STAGE_FREE_BP_INIT = 1 << 2, /* --F-- */
44 ZIO_STAGE_ISSUE_ASYNC = 1 << 3, /* RWF-- */
45 ZIO_STAGE_WRITE_BP_INIT = 1 << 4, /* -W--- */
47 ZIO_STAGE_CHECKSUM_GENERATE = 1 << 5, /* -W--- */
49 ZIO_STAGE_DDT_READ_START = 1 << 6, /* R---- */
50 ZIO_STAGE_DDT_READ_DONE = 1 << 7, /* R---- */
51 ZIO_STAGE_DDT_WRITE = 1 << 8, /* -W--- */
52 ZIO_STAGE_DDT_FREE = 1 << 9, /* --F-- */
54 ZIO_STAGE_GANG_ASSEMBLE = 1 << 10, /* RWFC- */
55 ZIO_STAGE_GANG_ISSUE = 1 << 11, /* RWFC- */
57 ZIO_STAGE_DVA_ALLOCATE = 1 << 12, /* -W--- */
58 ZIO_STAGE_DVA_FREE = 1 << 13, /* --F-- */
59 ZIO_STAGE_DVA_CLAIM = 1 << 14, /* ---C- */
61 ZIO_STAGE_READY = 1 << 15, /* RWFCI */
63 ZIO_STAGE_VDEV_IO_START = 1 << 16, /* RW--I */
64 ZIO_STAGE_VDEV_IO_DONE = 1 << 17, /* RW--I */
65 ZIO_STAGE_VDEV_IO_ASSESS = 1 << 18, /* RW--I */
67 ZIO_STAGE_CHECKSUM_VERIFY = 1 << 19, /* R---- */
69 ZIO_STAGE_DONE = 1 << 20 /* RWFCI */
72 #define ZIO_INTERLOCK_STAGES \
76 #define ZIO_INTERLOCK_PIPELINE \
79 #define ZIO_VDEV_IO_STAGES \
80 (ZIO_STAGE_VDEV_IO_START | \
81 ZIO_STAGE_VDEV_IO_DONE | \
82 ZIO_STAGE_VDEV_IO_ASSESS)
84 #define ZIO_VDEV_CHILD_PIPELINE \
85 (ZIO_VDEV_IO_STAGES | \
88 #define ZIO_READ_COMMON_STAGES \
89 (ZIO_INTERLOCK_STAGES | \
90 ZIO_VDEV_IO_STAGES | \
91 ZIO_STAGE_CHECKSUM_VERIFY)
93 #define ZIO_READ_PHYS_PIPELINE \
94 ZIO_READ_COMMON_STAGES
96 #define ZIO_READ_PIPELINE \
97 (ZIO_READ_COMMON_STAGES | \
98 ZIO_STAGE_READ_BP_INIT)
100 #define ZIO_DDT_CHILD_READ_PIPELINE \
101 ZIO_READ_COMMON_STAGES
103 #define ZIO_DDT_READ_PIPELINE \
104 (ZIO_INTERLOCK_STAGES | \
105 ZIO_STAGE_READ_BP_INIT | \
106 ZIO_STAGE_DDT_READ_START | \
107 ZIO_STAGE_DDT_READ_DONE)
109 #define ZIO_WRITE_COMMON_STAGES \
110 (ZIO_INTERLOCK_STAGES | \
111 ZIO_VDEV_IO_STAGES | \
112 ZIO_STAGE_ISSUE_ASYNC | \
113 ZIO_STAGE_CHECKSUM_GENERATE)
115 #define ZIO_WRITE_PHYS_PIPELINE \
116 ZIO_WRITE_COMMON_STAGES
118 #define ZIO_REWRITE_PIPELINE \
119 (ZIO_WRITE_COMMON_STAGES | \
120 ZIO_STAGE_WRITE_BP_INIT)
122 #define ZIO_WRITE_PIPELINE \
123 (ZIO_WRITE_COMMON_STAGES | \
124 ZIO_STAGE_WRITE_BP_INIT | \
125 ZIO_STAGE_DVA_ALLOCATE)
127 #define ZIO_DDT_CHILD_WRITE_PIPELINE \
128 (ZIO_INTERLOCK_STAGES | \
129 ZIO_VDEV_IO_STAGES | \
130 ZIO_STAGE_DVA_ALLOCATE)
132 #define ZIO_DDT_WRITE_PIPELINE \
133 (ZIO_INTERLOCK_STAGES | \
134 ZIO_STAGE_ISSUE_ASYNC | \
135 ZIO_STAGE_WRITE_BP_INIT | \
136 ZIO_STAGE_CHECKSUM_GENERATE | \
139 #define ZIO_GANG_STAGES \
140 (ZIO_STAGE_GANG_ASSEMBLE | \
141 ZIO_STAGE_GANG_ISSUE)
143 #define ZIO_FREE_PIPELINE \
144 (ZIO_INTERLOCK_STAGES | \
145 ZIO_STAGE_FREE_BP_INIT | \
148 #define ZIO_DDT_FREE_PIPELINE \
149 (ZIO_INTERLOCK_STAGES | \
150 ZIO_STAGE_FREE_BP_INIT | \
151 ZIO_STAGE_ISSUE_ASYNC | \
154 #define ZIO_CLAIM_PIPELINE \
155 (ZIO_INTERLOCK_STAGES | \
158 #define ZIO_IOCTL_PIPELINE \
159 (ZIO_INTERLOCK_STAGES | \
160 ZIO_STAGE_VDEV_IO_START | \
161 ZIO_STAGE_VDEV_IO_ASSESS)
163 #define ZIO_BLOCKING_STAGES \
164 (ZIO_STAGE_DVA_ALLOCATE | \
165 ZIO_STAGE_DVA_CLAIM | \
166 ZIO_STAGE_VDEV_IO_START)
168 extern void zio_inject_init(void);
169 extern void zio_inject_fini(void);
175 #endif /* _ZIO_IMPL_H */