Deleted Added
full compact
zfsimpl.h (208047) zfsimpl.h (209962)
1/*-
2 * Copyright (c) 2002 McAfee, Inc.
3 * All rights reserved.
4 *
5 * This software was developed for the FreeBSD Project by Marshall
6 * Kirk McKusick and McAfee Research,, the Security Research Division of
7 * McAfee, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as
8 * part of the DARPA CHATS research program

--- 35 unchanged lines hidden (view full) ---

44 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
45 * If applicable, add the following below this CDDL HEADER, with the
46 * fields enclosed by brackets "[]" replaced with your own identifying
47 * information: Portions Copyright [yyyy] [name of copyright owner]
48 *
49 * CDDL HEADER END
50 */
51/*
1/*-
2 * Copyright (c) 2002 McAfee, Inc.
3 * All rights reserved.
4 *
5 * This software was developed for the FreeBSD Project by Marshall
6 * Kirk McKusick and McAfee Research,, the Security Research Division of
7 * McAfee, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as
8 * part of the DARPA CHATS research program

--- 35 unchanged lines hidden (view full) ---

44 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
45 * If applicable, add the following below this CDDL HEADER, with the
46 * fields enclosed by brackets "[]" replaced with your own identifying
47 * information: Portions Copyright [yyyy] [name of copyright owner]
48 *
49 * CDDL HEADER END
50 */
51/*
52 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
52 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
53 * Use is subject to license terms.
54 */
55
56/* CRC64 table */
57#define ZFS_CRC64_POLY 0xC96C5795D7870F42ULL /* ECMA-182, reflected form */
58
59/*
60 * Macros for various sorts of alignment and rounding when the alignment

--- 251 unchanged lines hidden (view full) ---

312
313#define ZBT_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */
314
315typedef struct zio_block_tail {
316 uint64_t zbt_magic; /* for validation, endianness */
317 zio_cksum_t zbt_cksum; /* 256-bit checksum */
318} zio_block_tail_t;
319
53 * Use is subject to license terms.
54 */
55
56/* CRC64 table */
57#define ZFS_CRC64_POLY 0xC96C5795D7870F42ULL /* ECMA-182, reflected form */
58
59/*
60 * Macros for various sorts of alignment and rounding when the alignment

--- 251 unchanged lines hidden (view full) ---

312
313#define ZBT_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */
314
315typedef struct zio_block_tail {
316 uint64_t zbt_magic; /* for validation, endianness */
317 zio_cksum_t zbt_cksum; /* 256-bit checksum */
318} zio_block_tail_t;
319
320#define VDEV_SKIP_SIZE (8 << 10)
321#define VDEV_BOOT_HEADER_SIZE (8 << 10)
320#define VDEV_PAD_SIZE (8 << 10)
321/* 2 padding areas (vl_pad1 and vl_pad2) to skip */
322#define VDEV_SKIP_SIZE VDEV_PAD_SIZE * 2
322#define VDEV_PHYS_SIZE (112 << 10)
323#define VDEV_UBERBLOCK_RING (128 << 10)
324
325#define VDEV_UBERBLOCK_SHIFT(vd) \
326 MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT)
327#define VDEV_UBERBLOCK_COUNT(vd) \
328 (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd))
329#define VDEV_UBERBLOCK_OFFSET(vd, n) \
330 offsetof(vdev_label_t, vl_uberblock[(n) << VDEV_UBERBLOCK_SHIFT(vd)])
331#define VDEV_UBERBLOCK_SIZE(vd) (1ULL << VDEV_UBERBLOCK_SHIFT(vd))
332
323#define VDEV_PHYS_SIZE (112 << 10)
324#define VDEV_UBERBLOCK_RING (128 << 10)
325
326#define VDEV_UBERBLOCK_SHIFT(vd) \
327 MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT)
328#define VDEV_UBERBLOCK_COUNT(vd) \
329 (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd))
330#define VDEV_UBERBLOCK_OFFSET(vd, n) \
331 offsetof(vdev_label_t, vl_uberblock[(n) << VDEV_UBERBLOCK_SHIFT(vd)])
332#define VDEV_UBERBLOCK_SIZE(vd) (1ULL << VDEV_UBERBLOCK_SHIFT(vd))
333
333/* ZFS boot block */
334#define VDEV_BOOT_MAGIC 0x2f5b007b10cULL
335#define VDEV_BOOT_VERSION 1 /* version number */
336
337typedef struct vdev_boot_header {
338 uint64_t vb_magic; /* VDEV_BOOT_MAGIC */
339 uint64_t vb_version; /* VDEV_BOOT_VERSION */
340 uint64_t vb_offset; /* start offset (bytes) */
341 uint64_t vb_size; /* size (bytes) */
342 char vb_pad[VDEV_BOOT_HEADER_SIZE - 4 * sizeof (uint64_t)];
343} vdev_boot_header_t;
344
345typedef struct vdev_phys {
346 char vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_block_tail_t)];
347 zio_block_tail_t vp_zbt;
348} vdev_phys_t;
349
350typedef struct vdev_label {
334typedef struct vdev_phys {
335 char vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_block_tail_t)];
336 zio_block_tail_t vp_zbt;
337} vdev_phys_t;
338
339typedef struct vdev_label {
351 char vl_pad[VDEV_SKIP_SIZE]; /* 8K */
352 vdev_boot_header_t vl_boot_header; /* 8K */
340 char vl_pad1[VDEV_PAD_SIZE]; /* 8K */
341 char vl_pad2[VDEV_PAD_SIZE]; /* 8K */
353 vdev_phys_t vl_vdev_phys; /* 112K */
354 char vl_uberblock[VDEV_UBERBLOCK_RING]; /* 128K */
355} vdev_label_t; /* 256K total */
356
357/*
358 * vdev_dirty() flags
359 */
360#define VDD_METASLAB 0x01

--- 114 unchanged lines hidden (view full) ---

475#define SPA_VERSION_7 7ULL
476#define SPA_VERSION_8 8ULL
477#define SPA_VERSION_9 9ULL
478#define SPA_VERSION_10 10ULL
479#define SPA_VERSION_11 11ULL
480#define SPA_VERSION_12 12ULL
481#define SPA_VERSION_13 13ULL
482#define SPA_VERSION_14 14ULL
342 vdev_phys_t vl_vdev_phys; /* 112K */
343 char vl_uberblock[VDEV_UBERBLOCK_RING]; /* 128K */
344} vdev_label_t; /* 256K total */
345
346/*
347 * vdev_dirty() flags
348 */
349#define VDD_METASLAB 0x01

--- 114 unchanged lines hidden (view full) ---

464#define SPA_VERSION_7 7ULL
465#define SPA_VERSION_8 8ULL
466#define SPA_VERSION_9 9ULL
467#define SPA_VERSION_10 10ULL
468#define SPA_VERSION_11 11ULL
469#define SPA_VERSION_12 12ULL
470#define SPA_VERSION_13 13ULL
471#define SPA_VERSION_14 14ULL
472#define SPA_VERSION_15 15ULL
483/*
484 * When bumping up SPA_VERSION, make sure GRUB ZFS understand the on-disk
485 * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*},
486 * and do the appropriate changes.
487 */
473/*
474 * When bumping up SPA_VERSION, make sure GRUB ZFS understand the on-disk
475 * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*},
476 * and do the appropriate changes.
477 */
488#define SPA_VERSION SPA_VERSION_14
489#define SPA_VERSION_STRING "14"
478#define SPA_VERSION SPA_VERSION_15
479#define SPA_VERSION_STRING "15"
490
491/*
492 * Symbolic names for the changes that caused a SPA_VERSION switch.
493 * Used in the code when checking for presence or absence of a feature.
494 * Feel free to define multiple symbolic names for each version if there
495 * were multiple changes to on-disk structures during that version.
496 *
497 * NOTE: When checking the current SPA_VERSION in your code, be sure

--- 19 unchanged lines hidden (view full) ---

517#define SPA_VERSION_UNIQUE_ACCURATE SPA_VERSION_9
518#define SPA_VERSION_L2CACHE SPA_VERSION_10
519#define SPA_VERSION_NEXT_CLONES SPA_VERSION_11
520#define SPA_VERSION_ORIGIN SPA_VERSION_11
521#define SPA_VERSION_DSL_SCRUB SPA_VERSION_11
522#define SPA_VERSION_SNAP_PROPS SPA_VERSION_12
523#define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13
524#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14
480
481/*
482 * Symbolic names for the changes that caused a SPA_VERSION switch.
483 * Used in the code when checking for presence or absence of a feature.
484 * Feel free to define multiple symbolic names for each version if there
485 * were multiple changes to on-disk structures during that version.
486 *
487 * NOTE: When checking the current SPA_VERSION in your code, be sure

--- 19 unchanged lines hidden (view full) ---

507#define SPA_VERSION_UNIQUE_ACCURATE SPA_VERSION_9
508#define SPA_VERSION_L2CACHE SPA_VERSION_10
509#define SPA_VERSION_NEXT_CLONES SPA_VERSION_11
510#define SPA_VERSION_ORIGIN SPA_VERSION_11
511#define SPA_VERSION_DSL_SCRUB SPA_VERSION_11
512#define SPA_VERSION_SNAP_PROPS SPA_VERSION_12
513#define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13
514#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14
515#define SPA_VERSION_USERSPACE SPA_VERSION_15
525
526/*
527 * The following are configuration names used in the nvlist describing a pool's
528 * configuration.
529 */
530#define ZPOOL_CONFIG_VERSION "version"
531#define ZPOOL_CONFIG_POOL_NAME "name"
532#define ZPOOL_CONFIG_POOL_STATE "state"

--- 261 unchanged lines hidden (view full) ---

794 uint64_t zh_claim_seq; /* highest claimed sequence number */
795 uint64_t zh_pad[5];
796} zil_header_t;
797
798typedef struct objset_phys {
799 dnode_phys_t os_meta_dnode;
800 zil_header_t os_zil_header;
801 uint64_t os_type;
516
517/*
518 * The following are configuration names used in the nvlist describing a pool's
519 * configuration.
520 */
521#define ZPOOL_CONFIG_VERSION "version"
522#define ZPOOL_CONFIG_POOL_NAME "name"
523#define ZPOOL_CONFIG_POOL_STATE "state"

--- 261 unchanged lines hidden (view full) ---

785 uint64_t zh_claim_seq; /* highest claimed sequence number */
786 uint64_t zh_pad[5];
787} zil_header_t;
788
789typedef struct objset_phys {
790 dnode_phys_t os_meta_dnode;
791 zil_header_t os_zil_header;
792 uint64_t os_type;
802 char os_pad[1024 - sizeof (dnode_phys_t) - sizeof (zil_header_t) -
803 sizeof (uint64_t)];
793 uint64_t os_flags;
794 char os_pad[2048 - sizeof (dnode_phys_t)*3 -
795 sizeof (zil_header_t) - sizeof (uint64_t)*2];
796 dnode_phys_t os_userused_dnode;
797 dnode_phys_t os_groupused_dnode;
804} objset_phys_t;
805
806typedef struct dsl_dir_phys {
807 uint64_t dd_creation_time; /* not actually used */
808 uint64_t dd_head_dataset_obj;
809 uint64_t dd_parent_obj;
810 uint64_t dd_clone_parent_obj;
811 uint64_t dd_child_dir_zapobj;

--- 397 unchanged lines hidden ---
798} objset_phys_t;
799
800typedef struct dsl_dir_phys {
801 uint64_t dd_creation_time; /* not actually used */
802 uint64_t dd_head_dataset_obj;
803 uint64_t dd_parent_obj;
804 uint64_t dd_clone_parent_obj;
805 uint64_t dd_child_dir_zapobj;

--- 397 unchanged lines hidden ---