1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
7 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
15 #define ZEC_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */
17 typedef struct zio_eck {
18 uint64_t zec_magic; /* for validation, endianness */
19 zio_cksum_t zec_cksum; /* 256-bit checksum */
23 * Gang block headers are self-checksumming and contain an array
26 #define SPA_GANGBLOCKSIZE SPA_MINBLOCKSIZE
27 #define SPA_GBH_NBLKPTRS ((SPA_GANGBLOCKSIZE - \
28 sizeof(zio_eck_t)) / sizeof(blkptr_t))
29 #define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \
31 (SPA_GBH_NBLKPTRS * sizeof(blkptr_t))) /\
34 #define ZIO_GET_IOSIZE(zio) \
35 (BP_IS_GANG((zio)->io_bp) ? \
36 SPA_GANGBLOCKSIZE : BP_GET_PSIZE((zio)->io_bp))
38 typedef struct zio_gbh {
39 blkptr_t zg_blkptr[SPA_GBH_NBLKPTRS];
40 uint64_t zg_filler[SPA_GBH_FILLER];
45 ZIO_CHECKSUM_INHERIT = 0,
49 ZIO_CHECKSUM_GANG_HEADER,
51 ZIO_CHECKSUM_FLETCHER_2,
52 ZIO_CHECKSUM_FLETCHER_4,
55 ZIO_CHECKSUM_FUNCTIONS
58 #define ZIO_CHECKSUM_ON_VALUE ZIO_CHECKSUM_FLETCHER_2
59 #define ZIO_CHECKSUM_DEFAULT ZIO_CHECKSUM_ON
62 ZIO_COMPRESS_INHERIT = 0,
76 ZIO_COMPRESS_FUNCTIONS