1N/A/*
1N/A * GRUB -- GRand Unified Bootloader
1N/A * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
1N/A *
1N/A * This program is free software; you can redistribute it and/or modify
1N/A * it under the terms of the GNU General Public License as published by
1N/A * the Free Software Foundation; either version 2 of the License, or
1N/A * (at your option) any later version.
1N/A *
1N/A * This program is distributed in the hope that it will be useful,
1N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1N/A * GNU General Public License for more details.
1N/A *
1N/A * You should have received a copy of the GNU General Public License
1N/A * along with this program; if not, write to the Free Software
1N/A * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1N/A */
1N/A/*
1N/A * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
1N/A */
1N/A
1N/A#ifndef _ZIO_H
1N/A#define _ZIO_H
1N/A
1N/A#define ZEC_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */
1N/A
1N/Atypedef struct zio_eck {
1N/A uint64_t zec_magic; /* for validation, endianness */
1N/A zio_cksum_t zec_cksum; /* 256-bit checksum */
1N/A} zio_eck_t;
1N/A
1N/A/*
1N/A * Gang block headers are self-checksumming and contain an array
1N/A * of block pointers.
1N/A */
1N/A#define SPA_GANGBLOCKSIZE SPA_MINBLOCKSIZE
1N/A#define SPA_GBH_NBLKPTRS ((SPA_GANGBLOCKSIZE - \
1N/A sizeof (zio_eck_t)) / sizeof (blkptr_t))
1N/A#define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \
1N/A sizeof (zio_eck_t) - \
1N/A (SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\
1N/A sizeof (uint64_t))
1N/A
1N/A#define ZIO_GET_IOSIZE(zio) \
1N/A (BP_IS_GANG((zio)->io_bp) ? \
1N/A SPA_GANGBLOCKSIZE : BP_GET_PSIZE((zio)->io_bp))
1N/A
1N/Atypedef struct zio_gbh {
1N/A blkptr_t zg_blkptr[SPA_GBH_NBLKPTRS];
1N/A uint64_t zg_filler[SPA_GBH_FILLER];
1N/A zio_eck_t zg_tail;
1N/A} zio_gbh_phys_t;
1N/A
1N/Aenum zio_checksum {
1N/A ZIO_CHECKSUM_INHERIT = 0,
1N/A ZIO_CHECKSUM_ON,
1N/A ZIO_CHECKSUM_OFF,
1N/A ZIO_CHECKSUM_LABEL,
1N/A ZIO_CHECKSUM_GANG_HEADER,
1N/A ZIO_CHECKSUM_ZILOG,
1N/A ZIO_CHECKSUM_FLETCHER_2,
1N/A ZIO_CHECKSUM_FLETCHER_4,
1N/A ZIO_CHECKSUM_SHA256,
1N/A ZIO_CHECKSUM_ZILOG2,
1N/A ZIO_CHECKSUM_SHA256_MAC,
1N/A ZIO_CHECKSUM_FUNCTIONS
1N/A};
1N/A
1N/Aenum zio_compress {
1N/A ZIO_COMPRESS_INHERIT = 0,
1N/A ZIO_COMPRESS_ON,
1N/A ZIO_COMPRESS_OFF,
1N/A ZIO_COMPRESS_LZJB,
1N/A ZIO_COMPRESS_EMPTY,
1N/A ZIO_COMPRESS_FUNCTIONS
1N/A};
1N/A
1N/A#endif /* _ZIO_H */