ia64/xen-unstable

view tools/libfsimage/zfs/zfs-include/zio.h @ 19648:f0e2df69a8eb

x86 hvm: Allow cross-vendor migration

Intercept #UD and emulate SYSCALL/SYSENTER/SYSEXIT as necessary.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 26 15:01:36 2009 +0100 (2009-05-26)
parents 64f790e90d3d
children
line source
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
4 *
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.
9 *
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.
14 *
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.
18 */
19 /*
20 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
21 * Use is subject to license terms.
22 */
24 #ifndef _ZIO_H
25 #define _ZIO_H
27 #define ZBT_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */
29 typedef struct zio_block_tail {
30 uint64_t zbt_magic; /* for validation, endianness */
31 zio_cksum_t zbt_cksum; /* 256-bit checksum */
32 } zio_block_tail_t;
34 /*
35 * Gang block headers are self-checksumming and contain an array
36 * of block pointers.
37 */
38 #define SPA_GANGBLOCKSIZE SPA_MINBLOCKSIZE
39 #define SPA_GBH_NBLKPTRS ((SPA_GANGBLOCKSIZE - \
40 sizeof (zio_block_tail_t)) / sizeof (blkptr_t))
41 #define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \
42 sizeof (zio_block_tail_t) - \
43 (SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\
44 sizeof (uint64_t))
46 #define ZIO_GET_IOSIZE(zio) \
47 (BP_IS_GANG((zio)->io_bp) ? \
48 SPA_GANGBLOCKSIZE : BP_GET_PSIZE((zio)->io_bp))
50 typedef struct zio_gbh {
51 blkptr_t zg_blkptr[SPA_GBH_NBLKPTRS];
52 uint64_t zg_filler[SPA_GBH_FILLER];
53 zio_block_tail_t zg_tail;
54 } zio_gbh_phys_t;
56 enum zio_checksum {
57 ZIO_CHECKSUM_INHERIT = 0,
58 ZIO_CHECKSUM_ON,
59 ZIO_CHECKSUM_OFF,
60 ZIO_CHECKSUM_LABEL,
61 ZIO_CHECKSUM_GANG_HEADER,
62 ZIO_CHECKSUM_ZILOG,
63 ZIO_CHECKSUM_FLETCHER_2,
64 ZIO_CHECKSUM_FLETCHER_4,
65 ZIO_CHECKSUM_SHA256,
66 ZIO_CHECKSUM_FUNCTIONS
67 };
69 #define ZIO_CHECKSUM_ON_VALUE ZIO_CHECKSUM_FLETCHER_2
70 #define ZIO_CHECKSUM_DEFAULT ZIO_CHECKSUM_ON
72 enum zio_compress {
73 ZIO_COMPRESS_INHERIT = 0,
74 ZIO_COMPRESS_ON,
75 ZIO_COMPRESS_OFF,
76 ZIO_COMPRESS_LZJB,
77 ZIO_COMPRESS_EMPTY,
78 ZIO_COMPRESS_FUNCTIONS
79 };
81 #endif /* _ZIO_H */