FreeBSD ZFS
The Zettabyte File System

sys/zio_impl.h

Go to the documentation of this file.
00001 /*
00002  * CDDL HEADER START
00003  *
00004  * The contents of this file are subject to the terms of the
00005  * Common Development and Distribution License (the "License").
00006  * You may not use this file except in compliance with the License.
00007  *
00008  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
00009  * or http://www.opensolaris.org/os/licensing.
00010  * See the License for the specific language governing permissions
00011  * and limitations under the License.
00012  *
00013  * When distributing Covered Code, include this CDDL HEADER in each
00014  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
00015  * If applicable, add the following below this CDDL HEADER, with the
00016  * fields enclosed by brackets "[]" replaced with your own identifying
00017  * information: Portions Copyright [yyyy] [name of copyright owner]
00018  *
00019  * CDDL HEADER END
00020  */
00021 /*
00022  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
00023  * Use is subject to license terms.
00024  */
00025 
00026 #ifndef _ZIO_IMPL_H
00027 #define _ZIO_IMPL_H
00028 
00029 #include <sys/zfs_context.h>
00030 #include <sys/zio.h>
00031 
00032 #ifdef  __cplusplus
00033 extern "C" {
00034 #endif
00035 
00039 enum zio_stage {
00040         ZIO_STAGE_OPEN                  = 1 << 0,       
00042         ZIO_STAGE_READ_BP_INIT          = 1 << 1,       
00043         ZIO_STAGE_FREE_BP_INIT          = 1 << 2,       
00044         ZIO_STAGE_ISSUE_ASYNC           = 1 << 3,       
00045         ZIO_STAGE_WRITE_BP_INIT         = 1 << 4,       
00047         ZIO_STAGE_CHECKSUM_GENERATE     = 1 << 5,       
00049         ZIO_STAGE_DDT_READ_START        = 1 << 6,       
00050         ZIO_STAGE_DDT_READ_DONE         = 1 << 7,       
00051         ZIO_STAGE_DDT_WRITE             = 1 << 8,       
00052         ZIO_STAGE_DDT_FREE              = 1 << 9,       
00054         ZIO_STAGE_GANG_ASSEMBLE         = 1 << 10,      
00055         ZIO_STAGE_GANG_ISSUE            = 1 << 11,      
00057         ZIO_STAGE_DVA_ALLOCATE          = 1 << 12,      
00058         ZIO_STAGE_DVA_FREE              = 1 << 13,      
00059         ZIO_STAGE_DVA_CLAIM             = 1 << 14,      
00061         ZIO_STAGE_READY                 = 1 << 15,      
00063         ZIO_STAGE_VDEV_IO_START         = 1 << 16,      
00064         ZIO_STAGE_VDEV_IO_DONE          = 1 << 17,      
00065         ZIO_STAGE_VDEV_IO_ASSESS        = 1 << 18,      
00067         ZIO_STAGE_CHECKSUM_VERIFY       = 1 << 19,      
00069         ZIO_STAGE_DONE                  = 1 << 20       
00070 };
00071 
00072 #define ZIO_INTERLOCK_STAGES                    \
00073         (ZIO_STAGE_READY |                      \
00074         ZIO_STAGE_DONE)
00075 
00076 #define ZIO_INTERLOCK_PIPELINE                  \
00077         ZIO_INTERLOCK_STAGES
00078 
00079 #define ZIO_VDEV_IO_STAGES                      \
00080         (ZIO_STAGE_VDEV_IO_START |              \
00081         ZIO_STAGE_VDEV_IO_DONE |                \
00082         ZIO_STAGE_VDEV_IO_ASSESS)
00083 
00084 #define ZIO_VDEV_CHILD_PIPELINE                 \
00085         (ZIO_VDEV_IO_STAGES |                   \
00086         ZIO_STAGE_DONE)
00087 
00088 #define ZIO_READ_COMMON_STAGES                  \
00089         (ZIO_INTERLOCK_STAGES |                 \
00090         ZIO_VDEV_IO_STAGES |                    \
00091         ZIO_STAGE_CHECKSUM_VERIFY)
00092 
00093 #define ZIO_READ_PHYS_PIPELINE                  \
00094         ZIO_READ_COMMON_STAGES
00095 
00096 #define ZIO_READ_PIPELINE                       \
00097         (ZIO_READ_COMMON_STAGES |               \
00098         ZIO_STAGE_READ_BP_INIT)
00099 
00100 #define ZIO_DDT_CHILD_READ_PIPELINE             \
00101         ZIO_READ_COMMON_STAGES
00102 
00103 #define ZIO_DDT_READ_PIPELINE                   \
00104         (ZIO_INTERLOCK_STAGES |                 \
00105         ZIO_STAGE_READ_BP_INIT |                \
00106         ZIO_STAGE_DDT_READ_START |              \
00107         ZIO_STAGE_DDT_READ_DONE)
00108 
00109 #define ZIO_WRITE_COMMON_STAGES                 \
00110         (ZIO_INTERLOCK_STAGES |                 \
00111         ZIO_VDEV_IO_STAGES |                    \
00112         ZIO_STAGE_ISSUE_ASYNC |                 \
00113         ZIO_STAGE_CHECKSUM_GENERATE)
00114 
00115 #define ZIO_WRITE_PHYS_PIPELINE                 \
00116         ZIO_WRITE_COMMON_STAGES
00117 
00118 #define ZIO_REWRITE_PIPELINE                    \
00119         (ZIO_WRITE_COMMON_STAGES |              \
00120         ZIO_STAGE_WRITE_BP_INIT)
00121 
00122 #define ZIO_WRITE_PIPELINE                      \
00123         (ZIO_WRITE_COMMON_STAGES |              \
00124         ZIO_STAGE_WRITE_BP_INIT |               \
00125         ZIO_STAGE_DVA_ALLOCATE)
00126 
00127 #define ZIO_DDT_CHILD_WRITE_PIPELINE            \
00128         (ZIO_INTERLOCK_STAGES |                 \
00129         ZIO_VDEV_IO_STAGES |                    \
00130         ZIO_STAGE_DVA_ALLOCATE)
00131 
00132 #define ZIO_DDT_WRITE_PIPELINE                  \
00133         (ZIO_INTERLOCK_STAGES |                 \
00134         ZIO_STAGE_ISSUE_ASYNC |                 \
00135         ZIO_STAGE_WRITE_BP_INIT |               \
00136         ZIO_STAGE_CHECKSUM_GENERATE |           \
00137         ZIO_STAGE_DDT_WRITE)
00138 
00139 #define ZIO_GANG_STAGES                         \
00140         (ZIO_STAGE_GANG_ASSEMBLE |              \
00141         ZIO_STAGE_GANG_ISSUE)
00142 
00143 #define ZIO_FREE_PIPELINE                       \
00144         (ZIO_INTERLOCK_STAGES |                 \
00145         ZIO_STAGE_FREE_BP_INIT |                \
00146         ZIO_STAGE_DVA_FREE |                    \
00147         ZIO_STAGE_VDEV_IO_START |               \
00148         ZIO_STAGE_VDEV_IO_ASSESS)
00149 
00150 #define ZIO_DDT_FREE_PIPELINE                   \
00151         (ZIO_INTERLOCK_STAGES |                 \
00152         ZIO_STAGE_FREE_BP_INIT |                \
00153         ZIO_STAGE_ISSUE_ASYNC |                 \
00154         ZIO_STAGE_DDT_FREE)
00155 
00156 #define ZIO_CLAIM_PIPELINE                      \
00157         (ZIO_INTERLOCK_STAGES |                 \
00158         ZIO_STAGE_DVA_CLAIM)
00159 
00160 #define ZIO_IOCTL_PIPELINE                      \
00161         (ZIO_INTERLOCK_STAGES |                 \
00162         ZIO_STAGE_VDEV_IO_START |               \
00163         ZIO_STAGE_VDEV_IO_ASSESS)
00164 
00165 #define ZIO_BLOCKING_STAGES                     \
00166         (ZIO_STAGE_DVA_ALLOCATE |               \
00167         ZIO_STAGE_DVA_CLAIM |                   \
00168         ZIO_STAGE_VDEV_IO_START)
00169 
00170 extern void zio_inject_init(void);
00171 extern void zio_inject_fini(void);
00172 
00173 #ifdef  __cplusplus
00174 }
00175 #endif
00176 
00177 #endif  /* _ZIO_IMPL_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines