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 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 #include <sys/zfs_context.h>
37 * I/O Groups: pipeline stage definitions.
39 typedef enum zio_stage
{
40 ZIO_STAGE_OPEN
= 0, /* RWFCI */
42 ZIO_STAGE_ISSUE_ASYNC
, /* -W--- */
44 ZIO_STAGE_READ_BP_INIT
, /* R---- */
45 ZIO_STAGE_WRITE_BP_INIT
, /* -W--- */
47 ZIO_STAGE_CHECKSUM_GENERATE
, /* -W--- */
49 ZIO_STAGE_GANG_ASSEMBLE
, /* RWFC- */
50 ZIO_STAGE_GANG_ISSUE
, /* RWFC- */
52 ZIO_STAGE_DVA_ALLOCATE
, /* -W--- */
53 ZIO_STAGE_DVA_FREE
, /* --F-- */
54 ZIO_STAGE_DVA_CLAIM
, /* ---C- */
56 ZIO_STAGE_READY
, /* RWFCI */
58 ZIO_STAGE_VDEV_IO_START
, /* RW--I */
59 ZIO_STAGE_VDEV_IO_DONE
, /* RW--I */
60 ZIO_STAGE_VDEV_IO_ASSESS
, /* RW--I */
62 ZIO_STAGE_CHECKSUM_VERIFY
, /* R---- */
64 ZIO_STAGE_DONE
, /* RWFCI */
68 #define ZIO_INTERLOCK_STAGES \
69 ((1U << ZIO_STAGE_READY) | \
70 (1U << ZIO_STAGE_DONE))
72 #define ZIO_INTERLOCK_PIPELINE \
75 #define ZIO_VDEV_IO_STAGES \
76 ((1U << ZIO_STAGE_VDEV_IO_START) | \
77 (1U << ZIO_STAGE_VDEV_IO_DONE) | \
78 (1U << ZIO_STAGE_VDEV_IO_ASSESS))
80 #define ZIO_VDEV_CHILD_PIPELINE \
81 (ZIO_VDEV_IO_STAGES | \
82 (1U << ZIO_STAGE_DONE))
84 #define ZIO_READ_COMMON_STAGES \
85 (ZIO_INTERLOCK_STAGES | \
86 ZIO_VDEV_IO_STAGES | \
87 (1U << ZIO_STAGE_CHECKSUM_VERIFY))
89 #define ZIO_READ_PHYS_PIPELINE \
90 ZIO_READ_COMMON_STAGES
92 #define ZIO_READ_PIPELINE \
93 (ZIO_READ_COMMON_STAGES | \
94 (1U << ZIO_STAGE_READ_BP_INIT))
96 #define ZIO_WRITE_COMMON_STAGES \
97 (ZIO_INTERLOCK_STAGES | \
98 ZIO_VDEV_IO_STAGES | \
99 (1U << ZIO_STAGE_ISSUE_ASYNC) | \
100 (1U << ZIO_STAGE_CHECKSUM_GENERATE))
102 #define ZIO_WRITE_PHYS_PIPELINE \
103 ZIO_WRITE_COMMON_STAGES
105 #define ZIO_REWRITE_PIPELINE \
106 (ZIO_WRITE_COMMON_STAGES | \
107 (1U << ZIO_STAGE_WRITE_BP_INIT))
109 #define ZIO_WRITE_PIPELINE \
110 (ZIO_WRITE_COMMON_STAGES | \
111 (1U << ZIO_STAGE_WRITE_BP_INIT) | \
112 (1U << ZIO_STAGE_DVA_ALLOCATE))
114 #define ZIO_GANG_STAGES \
115 ((1U << ZIO_STAGE_GANG_ASSEMBLE) | \
116 (1U << ZIO_STAGE_GANG_ISSUE))
118 #define ZIO_FREE_PIPELINE \
119 (ZIO_INTERLOCK_STAGES | \
120 (1U << ZIO_STAGE_DVA_FREE))
122 #define ZIO_CLAIM_PIPELINE \
123 (ZIO_INTERLOCK_STAGES | \
124 (1U << ZIO_STAGE_DVA_CLAIM))
126 #define ZIO_IOCTL_PIPELINE \
127 (ZIO_INTERLOCK_STAGES | \
128 (1U << ZIO_STAGE_VDEV_IO_START) | \
129 (1U << ZIO_STAGE_VDEV_IO_ASSESS))
131 #define ZIO_CONFIG_LOCK_BLOCKING_STAGES \
132 ((1U << ZIO_STAGE_VDEV_IO_START) | \
133 (1U << ZIO_STAGE_DVA_ALLOCATE) | \
134 (1U << ZIO_STAGE_DVA_CLAIM))
136 extern void zio_inject_init(void);
137 extern void zio_inject_fini(void);
143 #endif /* _ZIO_IMPL_H */