Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / zfs / zio.h
blobb1c46da3ae837a5f7735984bdf70d2aa87ddfdf8
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
5 * GRUB 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 3 of the License, or
8 * (at your option) any later version.
10 * GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
19 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
20 * Use is subject to license terms.
23 #ifndef _ZIO_H
24 #define _ZIO_H
26 #include <grub/zfs/spa.h>
28 #define ZEC_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */
30 typedef struct zio_eck {
31 grub_uint64_t zec_magic; /* for validation, endianness */
32 zio_cksum_t zec_cksum; /* 256-bit checksum */
33 } __attribute__ ((packed)) zio_eck_t;
36 * Gang block headers are self-checksumming and contain an array
37 * of block pointers.
39 #define SPA_GANGBLOCKSIZE SPA_MINBLOCKSIZE
40 #define SPA_GBH_NBLKPTRS ((SPA_GANGBLOCKSIZE - \
41 sizeof (zio_eck_t)) / sizeof (blkptr_t))
42 #define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \
43 sizeof (zio_eck_t) - \
44 (SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\
45 sizeof (grub_uint64_t))
47 #define ZIO_GET_IOSIZE(zio) \
48 (BP_IS_GANG((zio)->io_bp) ? \
49 SPA_GANGBLOCKSIZE : BP_GET_PSIZE((zio)->io_bp))
51 typedef struct zio_gbh {
52 blkptr_t zg_blkptr[SPA_GBH_NBLKPTRS];
53 grub_uint64_t zg_filler[SPA_GBH_FILLER];
54 zio_eck_t zg_tail;
55 } zio_gbh_phys_t;
57 enum zio_checksum {
58 ZIO_CHECKSUM_INHERIT = 0,
59 ZIO_CHECKSUM_ON,
60 ZIO_CHECKSUM_OFF,
61 ZIO_CHECKSUM_LABEL,
62 ZIO_CHECKSUM_GANG_HEADER,
63 ZIO_CHECKSUM_ZILOG,
64 ZIO_CHECKSUM_FLETCHER_2,
65 ZIO_CHECKSUM_FLETCHER_4,
66 ZIO_CHECKSUM_SHA256,
67 ZIO_CHECKSUM_ZILOG2,
68 ZIO_CHECKSUM_SHA256_MAC,
69 ZIO_CHECKSUM_FUNCTIONS
72 #define ZIO_CHECKSUM_ON_VALUE ZIO_CHECKSUM_FLETCHER_2
73 #define ZIO_CHECKSUM_DEFAULT ZIO_CHECKSUM_ON
75 enum zio_compress {
76 ZIO_COMPRESS_INHERIT = 0,
77 ZIO_COMPRESS_ON,
78 ZIO_COMPRESS_OFF,
79 ZIO_COMPRESS_LZJB,
80 ZIO_COMPRESS_EMPTY,
81 ZIO_COMPRESS_GZIP1,
82 ZIO_COMPRESS_GZIP2,
83 ZIO_COMPRESS_GZIP3,
84 ZIO_COMPRESS_GZIP4,
85 ZIO_COMPRESS_GZIP5,
86 ZIO_COMPRESS_GZIP6,
87 ZIO_COMPRESS_GZIP7,
88 ZIO_COMPRESS_GZIP8,
89 ZIO_COMPRESS_GZIP9,
90 ZIO_COMPRESS_ZLE,
91 ZIO_COMPRESS_FUNCTIONS
94 #endif /* _ZIO_H */