fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER START
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The contents of this file are subject to the terms of the
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * Common Development and Distribution License (the "License").
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * You may not use this file except in compliance with the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * or http://www.opensolaris.org/os/licensing.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * See the License for the specific language governing permissions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and limitations under the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * When distributing Covered Code, include this CDDL HEADER in each
fa9e4066f08beec538e775443c5be79dd423fcabahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * If applicable, add the following below this CDDL HEADER, with the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * fields enclosed by brackets "[]" replaced with your own identifying
fa9e4066f08beec538e775443c5be79dd423fcabahrens * information: Portions Copyright [yyyy] [name of copyright owner]
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER END
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Use is subject to license terms.
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
01f55e48fb4d524eaf70687728aa51b7762e2e97George Wilson/*
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
01f55e48fb4d524eaf70687728aa51b7762e2e97George Wilson */
01f55e48fb4d524eaf70687728aa51b7762e2e97George Wilson
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifndef _ZIO_IMPL_H
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define _ZIO_IMPL_H
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#include <sys/zfs_context.h>
fa9e4066f08beec538e775443c5be79dd423fcabahrens#include <sys/zio.h>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifdef __cplusplus
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson/*
9cb154a3c9f170904dce9bad5bd5a7d256b922a4Matthew Ahrens * XXX -- Describe ZFS I/O pipeline here. Fill in as needed.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * The ZFS I/O pipeline is comprised of various stages which are defined
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * in the zio_stage enum below. The individual stages are used to construct
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * these basic I/O operations: Read, Write, Free, Claim, and Ioctl.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * I/O operations: (XXX - provide detail for each of the operations)
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Read:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Write:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Free:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Claim:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Ioctl:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Although the most common pipeline are used by the basic I/O operations
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * above, there are some helper pipelines (one could consider them
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * sub-pipelines) which are used internally by the ZIO module and are
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * explained below:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Interlock Pipeline:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * The interlock pipeline is the most basic pipeline and is used by all
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * of the I/O operations. The interlock pipeline does not perform any I/O
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * and is used to coordinate the dependencies between I/Os that are being
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * issued (i.e. the parent/child relationship).
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Vdev child Pipeline:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * The vdev child pipeline is responsible for performing the physical I/O.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * It is in this pipeline where the I/O are queued and possibly cached.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * In addition to performing I/O, the pipeline is also responsible for
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * data transformations. The transformations performed are based on the
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * specific properties that user may have selected and modify the
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * behavior of the pipeline. Examples of supported transformations are
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * compression, dedup, and nop writes. Transformations will either modify
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * the data or the pipeline. This list below further describes each of
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * the supported transformations:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Compression:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * ZFS supports three different flavors of compression -- gzip, lzjb, and
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * zle. Compression occurs as part of the write pipeline and is performed
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * in the ZIO_STAGE_WRITE_BP_INIT stage.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Dedup:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Dedup reads are handled by the ZIO_STAGE_DDT_READ_START and
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * ZIO_STAGE_DDT_READ_DONE stages. These stages are added to an existing
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * read pipeline if the dedup bit is set on the block pointer.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * Writing a dedup block is performed by the ZIO_STAGE_DDT_WRITE stage
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * and added to a write pipeline if a user has enabled dedup on that
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * particular dataset.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson *
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * NOP Write:
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * The NOP write feature is performed by the ZIO_STAGE_NOP_WRITE stage
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * and is added to an existing write pipeline if a crypographically
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * secure checksum (i.e. SHA256) is enabled and compression is turned on.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * The NOP write stage will compare the checksums of the current data
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * on-disk (level-0 blocks only) and the data that is currently being written.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * If the checksum values are identical then the pipeline is converted to
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * an interlock pipeline skipping block allocation and bypassing the
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * physical I/O. The nop write feature can handle writes in either
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * syncing or open context (i.e. zil writes) and as a result is mutually
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson * exclusive with dedup.
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson */
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson
fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick * zio pipeline stage definitions
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwickenum zio_stage {
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_OPEN = 1 << 0, /* RWFCI */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_READ_BP_INIT = 1 << 1, /* R---- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_WRITE_BP_INIT = 1 << 2, /* -W--- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_FREE_BP_INIT = 1 << 3, /* --F-- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_ISSUE_ASYNC = 1 << 4, /* RWF-- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_WRITE_COMPRESS = 1 << 5, /* -W--- */
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff Bonwick
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_CHECKSUM_GENERATE = 1 << 6, /* -W--- */
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff Bonwick
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_NOP_WRITE = 1 << 7, /* -W--- */
80901aea8e78a2c20751f61f01bebd1d5b5c2ba5George Wilson
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DDT_READ_START = 1 << 8, /* R---- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DDT_READ_DONE = 1 << 9, /* R---- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DDT_WRITE = 1 << 10, /* -W--- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DDT_FREE = 1 << 11, /* --F-- */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_GANG_ASSEMBLE = 1 << 12, /* RWFC- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_GANG_ISSUE = 1 << 13, /* RWFC- */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DVA_THROTTLE = 1 << 14, /* -W--- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DVA_ALLOCATE = 1 << 15, /* -W--- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DVA_FREE = 1 << 16, /* --F-- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DVA_CLAIM = 1 << 17, /* ---C- */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_READY = 1 << 18, /* RWFCI */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_VDEV_IO_START = 1 << 19, /* RW--I */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_VDEV_IO_DONE = 1 << 20, /* RW--I */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_VDEV_IO_ASSESS = 1 << 21, /* RW--I */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_CHECKSUM_VERIFY = 1 << 22, /* R---- */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DONE = 1 << 23 /* RWFCI */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick};
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_INTERLOCK_STAGES \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_STAGE_READY | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DONE)
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_INTERLOCK_PIPELINE \
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff Bonwick ZIO_INTERLOCK_STAGES
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_VDEV_IO_STAGES \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_STAGE_VDEV_IO_START | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_VDEV_IO_DONE | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_VDEV_IO_ASSESS)
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_VDEV_CHILD_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_VDEV_IO_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DONE)
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_READ_COMMON_STAGES \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_INTERLOCK_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_VDEV_IO_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_CHECKSUM_VERIFY)
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_READ_PHYS_PIPELINE \
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff Bonwick ZIO_READ_COMMON_STAGES
0a4e9518a44f226be6d39383330b5b1792d2f184gw
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_READ_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_READ_COMMON_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_READ_BP_INIT)
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_DDT_CHILD_READ_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_READ_COMMON_STAGES
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_DDT_READ_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_INTERLOCK_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_READ_BP_INIT | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DDT_READ_START | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DDT_READ_DONE)
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_WRITE_COMMON_STAGES \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_INTERLOCK_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_VDEV_IO_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_ISSUE_ASYNC | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_CHECKSUM_GENERATE)
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_WRITE_PHYS_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_WRITE_COMMON_STAGES
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_REWRITE_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_WRITE_COMMON_STAGES | \
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_WRITE_COMPRESS | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_WRITE_BP_INIT)
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_WRITE_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_WRITE_COMMON_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_WRITE_BP_INIT | \
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_WRITE_COMPRESS | \
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DVA_THROTTLE | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DVA_ALLOCATE)
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_DDT_CHILD_WRITE_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_INTERLOCK_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_VDEV_IO_STAGES | \
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DVA_THROTTLE | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DVA_ALLOCATE)
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_DDT_WRITE_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_INTERLOCK_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_WRITE_BP_INIT | \
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_ISSUE_ASYNC | \
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_WRITE_COMPRESS | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_CHECKSUM_GENERATE | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DDT_WRITE)
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_GANG_STAGES \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_STAGE_GANG_ASSEMBLE | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_GANG_ISSUE)
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_FREE_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_INTERLOCK_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_FREE_BP_INIT | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DVA_FREE)
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_DDT_FREE_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_INTERLOCK_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_FREE_BP_INIT | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_ISSUE_ASYNC | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DDT_FREE)
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_CLAIM_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_INTERLOCK_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DVA_CLAIM)
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_IOCTL_PIPELINE \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_INTERLOCK_STAGES | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_VDEV_IO_START | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_VDEV_IO_ASSESS)
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick#define ZIO_BLOCKING_STAGES \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick (ZIO_STAGE_DVA_ALLOCATE | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_DVA_CLAIM | \
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick ZIO_STAGE_VDEV_IO_START)
fa9e4066f08beec538e775443c5be79dd423fcabahrens
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockextern void zio_inject_init(void);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockextern void zio_inject_fini(void);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifdef __cplusplus
fa9e4066f08beec538e775443c5be79dd423fcabahrens}
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* _ZIO_IMPL_H */