diff options
Diffstat (limited to 'include/sys/zio_impl.h')
-rw-r--r-- | include/sys/zio_impl.h | 78 |
1 files changed, 47 insertions, 31 deletions
diff --git a/include/sys/zio_impl.h b/include/sys/zio_impl.h index 4c998571653a..2c846a5d41f6 100644 --- a/include/sys/zio_impl.h +++ b/include/sys/zio_impl.h @@ -6,7 +6,7 @@ * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. + * or https://opensource.org/licenses/CDDL-1.0. * See the License for the specific language governing permissions * and limitations under the License. * @@ -25,6 +25,7 @@ /* * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2024, Klara Inc. */ #ifndef _ZIO_IMPL_H @@ -39,7 +40,7 @@ extern "C" { * * The ZFS I/O pipeline is comprised of various stages which are defined * in the zio_stage enum below. The individual stages are used to construct - * these basic I/O operations: Read, Write, Free, Claim, and Ioctl. + * these basic I/O operations: Read, Write, Free, Claim, Flush and Trim. * * I/O operations: (XXX - provide detail for each of the operations) * @@ -47,7 +48,8 @@ extern "C" { * Write: * Free: * Claim: - * Ioctl: + * Flush: + * Trim: * * Although the most common pipeline are used by the basic I/O operations * above, there are some helper pipelines (one could consider them @@ -77,6 +79,12 @@ extern "C" { * and zstd. Compression occurs as part of the write pipeline and is * performed in the ZIO_STAGE_WRITE_BP_INIT stage. * + * Block cloning: + * The block cloning functionality introduces ZIO_STAGE_BRT_FREE stage which + * is called during a free pipeline. If the block is referenced in the + * Block Cloning Table (BRT) we will just decrease its reference counter + * instead of actually freeing the block. + * * Dedup: * Dedup reads are handled by the ZIO_STAGE_DDT_READ_START and * ZIO_STAGE_DDT_READ_DONE stages. These stages are added to an existing @@ -112,45 +120,53 @@ extern "C" { /* * zio pipeline stage definitions + * + * NOTE: PLEASE UPDATE THE BITFIELD STRINGS IN zfs_valstr.c IF YOU ADD ANOTHER + * FLAG. */ enum zio_stage { - ZIO_STAGE_OPEN = 1 << 0, /* RWFCI */ + ZIO_STAGE_OPEN = 1 << 0, /* RWFCXT */ + + ZIO_STAGE_READ_BP_INIT = 1 << 1, /* R----- */ + ZIO_STAGE_WRITE_BP_INIT = 1 << 2, /* -W---- */ + ZIO_STAGE_FREE_BP_INIT = 1 << 3, /* --F--- */ + ZIO_STAGE_ISSUE_ASYNC = 1 << 4, /* -WF--T */ + ZIO_STAGE_WRITE_COMPRESS = 1 << 5, /* -W---- */ - ZIO_STAGE_READ_BP_INIT = 1 << 1, /* R---- */ - ZIO_STAGE_WRITE_BP_INIT = 1 << 2, /* -W--- */ - ZIO_STAGE_FREE_BP_INIT = 1 << 3, /* --F-- */ - ZIO_STAGE_ISSUE_ASYNC = 1 << 4, /* RWF-- */ - ZIO_STAGE_WRITE_COMPRESS = 1 << 5, /* -W--- */ + ZIO_STAGE_ENCRYPT = 1 << 6, /* -W---- */ + ZIO_STAGE_CHECKSUM_GENERATE = 1 << 7, /* -W---- */ - ZIO_STAGE_ENCRYPT = 1 << 6, /* -W--- */ - ZIO_STAGE_CHECKSUM_GENERATE = 1 << 7, /* -W--- */ + ZIO_STAGE_NOP_WRITE = 1 << 8, /* -W---- */ - ZIO_STAGE_NOP_WRITE = 1 << 8, /* -W--- */ + ZIO_STAGE_BRT_FREE = 1 << 9, /* --F--- */ - ZIO_STAGE_DDT_READ_START = 1 << 9, /* R---- */ - ZIO_STAGE_DDT_READ_DONE = 1 << 10, /* R---- */ - ZIO_STAGE_DDT_WRITE = 1 << 11, /* -W--- */ - ZIO_STAGE_DDT_FREE = 1 << 12, /* --F-- */ + ZIO_STAGE_DDT_READ_START = 1 << 10, /* R----- */ + ZIO_STAGE_DDT_READ_DONE = 1 << 11, /* R----- */ + ZIO_STAGE_DDT_WRITE = 1 << 12, /* -W---- */ + ZIO_STAGE_DDT_FREE = 1 << 13, /* --F--- */ - ZIO_STAGE_GANG_ASSEMBLE = 1 << 13, /* RWFC- */ - ZIO_STAGE_GANG_ISSUE = 1 << 14, /* RWFC- */ + ZIO_STAGE_GANG_ASSEMBLE = 1 << 14, /* RWFC-- */ + ZIO_STAGE_GANG_ISSUE = 1 << 15, /* RWFC-- */ - ZIO_STAGE_DVA_THROTTLE = 1 << 15, /* -W--- */ - ZIO_STAGE_DVA_ALLOCATE = 1 << 16, /* -W--- */ - ZIO_STAGE_DVA_FREE = 1 << 17, /* --F-- */ - ZIO_STAGE_DVA_CLAIM = 1 << 18, /* ---C- */ + ZIO_STAGE_DVA_THROTTLE = 1 << 16, /* -W---- */ + ZIO_STAGE_DVA_ALLOCATE = 1 << 17, /* -W---- */ + ZIO_STAGE_DVA_FREE = 1 << 18, /* --F--- */ + ZIO_STAGE_DVA_CLAIM = 1 << 19, /* ---C-- */ - ZIO_STAGE_READY = 1 << 19, /* RWFCI */ + ZIO_STAGE_READY = 1 << 20, /* RWFCXT */ - ZIO_STAGE_VDEV_IO_START = 1 << 20, /* RW--I */ - ZIO_STAGE_VDEV_IO_DONE = 1 << 21, /* RW--I */ - ZIO_STAGE_VDEV_IO_ASSESS = 1 << 22, /* RW--I */ + ZIO_STAGE_VDEV_IO_START = 1 << 21, /* RW--XT */ + ZIO_STAGE_VDEV_IO_DONE = 1 << 22, /* RW--XT */ + ZIO_STAGE_VDEV_IO_ASSESS = 1 << 23, /* RW--XT */ - ZIO_STAGE_CHECKSUM_VERIFY = 1 << 23, /* R---- */ + ZIO_STAGE_CHECKSUM_VERIFY = 1 << 24, /* R----- */ - ZIO_STAGE_DONE = 1 << 24 /* RWFCI */ + ZIO_STAGE_DONE = 1 << 25 /* RWFCXT */ }; +#define ZIO_ROOT_PIPELINE \ + ZIO_STAGE_DONE + #define ZIO_INTERLOCK_STAGES \ (ZIO_STAGE_READY | \ ZIO_STAGE_DONE) @@ -233,6 +249,7 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ + ZIO_STAGE_BRT_FREE | \ ZIO_STAGE_DVA_FREE) #define ZIO_DDT_FREE_PIPELINE \ @@ -245,10 +262,9 @@ enum zio_stage { (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_DVA_CLAIM) -#define ZIO_IOCTL_PIPELINE \ +#define ZIO_FLUSH_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ - ZIO_STAGE_VDEV_IO_START | \ - ZIO_STAGE_VDEV_IO_ASSESS) + ZIO_VDEV_IO_STAGES) #define ZIO_TRIM_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ |