2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
21 * Use is subject to license terms.
24 * Copyright 2013 by Saso Kiselkov. All rights reserved.
30 #define ZEC_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */
32 typedef struct zio_eck
{
33 uint64_t zec_magic
; /* for validation, endianness */
34 zio_cksum_t zec_cksum
; /* 256-bit checksum */
38 * Gang block headers are self-checksumming and contain an array
41 #define SPA_GANGBLOCKSIZE SPA_MINBLOCKSIZE
42 #define SPA_GBH_NBLKPTRS ((SPA_GANGBLOCKSIZE - \
43 sizeof (zio_eck_t)) / sizeof (blkptr_t))
44 #define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \
45 sizeof (zio_eck_t) - \
46 (SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\
49 #define ZIO_GET_IOSIZE(zio) \
50 (BP_IS_GANG((zio)->io_bp) ? \
51 SPA_GANGBLOCKSIZE : BP_GET_PSIZE((zio)->io_bp))
53 typedef struct zio_gbh
{
54 blkptr_t zg_blkptr
[SPA_GBH_NBLKPTRS
];
55 uint64_t zg_filler
[SPA_GBH_FILLER
];
60 ZIO_CHECKSUM_INHERIT
= 0,
64 ZIO_CHECKSUM_GANG_HEADER
,
66 ZIO_CHECKSUM_FLETCHER_2
,
67 ZIO_CHECKSUM_FLETCHER_4
,
70 ZIO_CHECKSUM_NOPARITY
,
74 ZIO_CHECKSUM_FUNCTIONS
78 ZIO_COMPRESS_INHERIT
= 0,
94 ZIO_COMPRESS_FUNCTIONS