fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER START
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 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * See the License for the specific language governing permissions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and limitations under the License.
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 * CDDL HEADER END
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Use is subject to license terms.
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
9cb154a3c9f170904dce9bad5bd5a7d256b922a4Matthew Ahrens * XXX -- Describe ZFS I/O pipeline here. Fill in as needed.
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 * I/O operations: (XXX - provide detail for each of the operations)
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 * 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 * 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 * 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 * 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 * 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 * 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.
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick * zio pipeline stage definitions
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_WRITE_COMPRESS = 1 << 5, /* -W--- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_CHECKSUM_GENERATE = 1 << 6, /* -W--- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_DDT_READ_START = 1 << 8, /* R---- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_GANG_ASSEMBLE = 1 << 12, /* RWFC- */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_VDEV_IO_START = 1 << 19, /* RW--I */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_VDEV_IO_ASSESS = 1 << 21, /* RW--I */
0f7643c7376dd69a08acbfc9d1d7d548b10c846aGeorge Wilson ZIO_STAGE_CHECKSUM_VERIFY = 1 << 22, /* R---- */
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockextern void zio_inject_init(void);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockextern void zio_inject_fini(void);
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* _ZIO_IMPL_H */