Print this page
4185 New hash algorithm support
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/grub/grub-0.97/stage2/zfs-include/zio.h
+++ new/usr/src/grub/grub-0.97/stage2/zfs-include/zio.h
1 1 /*
2 2 * GRUB -- GRand Unified Bootloader
3 3 * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
4 4 *
5 5 * This program is free software; you can redistribute it and/or modify
6 6 * it under the terms of the GNU General Public License as published by
7 7 * the Free Software Foundation; either version 2 of the License, or
8 8 * (at your option) any later version.
9 9 *
10 10 * This program is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 * GNU General Public License for more details.
14 14 *
15 15 * You should have received a copy of the GNU General Public License
16 16 * along with this program; if not, write to the Free Software
17 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 18 */
19 19 /*
20 20 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
21 21 * Use is subject to license terms.
22 22 */
23 23 /*
24 24 * Copyright 2013 by Saso Kiselkov. All rights reserved.
25 25 */
26 26
27 27 #ifndef _ZIO_H
28 28 #define _ZIO_H
29 29
30 30 #define ZEC_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */
31 31
32 32 typedef struct zio_eck {
33 33 uint64_t zec_magic; /* for validation, endianness */
34 34 zio_cksum_t zec_cksum; /* 256-bit checksum */
35 35 } zio_eck_t;
36 36
37 37 /*
38 38 * Gang block headers are self-checksumming and contain an array
39 39 * of block pointers.
40 40 */
41 41 #define SPA_GANGBLOCKSIZE SPA_MINBLOCKSIZE
42 42 #define SPA_GBH_NBLKPTRS ((SPA_GANGBLOCKSIZE - \
43 43 sizeof (zio_eck_t)) / sizeof (blkptr_t))
44 44 #define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \
45 45 sizeof (zio_eck_t) - \
46 46 (SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\
47 47 sizeof (uint64_t))
48 48
49 49 #define ZIO_GET_IOSIZE(zio) \
50 50 (BP_IS_GANG((zio)->io_bp) ? \
51 51 SPA_GANGBLOCKSIZE : BP_GET_PSIZE((zio)->io_bp))
52 52
53 53 typedef struct zio_gbh {
54 54 blkptr_t zg_blkptr[SPA_GBH_NBLKPTRS];
55 55 uint64_t zg_filler[SPA_GBH_FILLER];
56 56 zio_eck_t zg_tail;
57 57 } zio_gbh_phys_t;
58 58
59 59 enum zio_checksum {
↓ open down ↓ |
59 lines elided |
↑ open up ↑ |
60 60 ZIO_CHECKSUM_INHERIT = 0,
61 61 ZIO_CHECKSUM_ON,
62 62 ZIO_CHECKSUM_OFF,
63 63 ZIO_CHECKSUM_LABEL,
64 64 ZIO_CHECKSUM_GANG_HEADER,
65 65 ZIO_CHECKSUM_ZILOG,
66 66 ZIO_CHECKSUM_FLETCHER_2,
67 67 ZIO_CHECKSUM_FLETCHER_4,
68 68 ZIO_CHECKSUM_SHA256,
69 69 ZIO_CHECKSUM_ZILOG2,
70 + ZIO_CHECKSUM_SHA512,
70 71 ZIO_CHECKSUM_FUNCTIONS
71 72 };
72 73
73 74 enum zio_compress {
74 75 ZIO_COMPRESS_INHERIT = 0,
75 76 ZIO_COMPRESS_ON,
76 77 ZIO_COMPRESS_OFF,
77 78 ZIO_COMPRESS_LZJB,
78 79 ZIO_COMPRESS_EMPTY,
79 80 ZIO_COMPRESS_GZIP_1,
80 81 ZIO_COMPRESS_GZIP_2,
81 82 ZIO_COMPRESS_GZIP_3,
82 83 ZIO_COMPRESS_GZIP_4,
83 84 ZIO_COMPRESS_GZIP_5,
84 85 ZIO_COMPRESS_GZIP_6,
85 86 ZIO_COMPRESS_GZIP_7,
86 87 ZIO_COMPRESS_GZIP_8,
87 88 ZIO_COMPRESS_GZIP_9,
88 89 ZIO_COMPRESS_ZLE,
89 90 ZIO_COMPRESS_LZ4,
90 91 ZIO_COMPRESS_FUNCTIONS
91 92 };
92 93
93 94 #endif /* _ZIO_H */
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX