fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER START
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The contents of this file are subject to the terms of the
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick * Common Development and Distribution License (the "License").
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick * You may not use this file except in compliance with the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * or http://www.opensolaris.org/os/licensing.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * See the License for the specific language governing permissions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and limitations under the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * When distributing Covered Code, include this CDDL HEADER in each
fa9e4066f08beec538e775443c5be79dd423fcabahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * If applicable, add the following below this CDDL HEADER, with the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * fields enclosed by brackets "[]" replaced with your own identifying
fa9e4066f08beec538e775443c5be79dd423fcabahrens * information: Portions Copyright [yyyy] [name of copyright owner]
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER END
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Ling * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifndef _SYS_UBERBLOCK_IMPL_H
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define _SYS_UBERBLOCK_IMPL_H
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#include <sys/uberblock.h>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifdef __cplusplus
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The uberblock version is incremented whenever an incompatible on-disk
fa9e4066f08beec538e775443c5be79dd423fcabahrens * format change is made to the SPA, DMU, or ZAP.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Note: the first two fields should never be moved. When a storage pool
fa9e4066f08beec538e775443c5be79dd423fcabahrens * is opened, the uberblock must be read off the disk before the version
fa9e4066f08beec538e775443c5be79dd423fcabahrens * can be checked. If the ub_version field is moved, we may not detect
fa9e4066f08beec538e775443c5be79dd423fcabahrens * version mismatch. If the ub_magic field is moved, applications that
fa9e4066f08beec538e775443c5be79dd423fcabahrens * expect the magic number in the first word won't work.
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define UBERBLOCK_MAGIC 0x00bab10c /* oo-ba-bloc! */
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick#define UBERBLOCK_SHIFT 10 /* up to 1K */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensstruct uberblock {
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t ub_magic; /* UBERBLOCK_MAGIC */
e7437265dc2a4920c197ed4337665539d358b22cahrens uint64_t ub_version; /* SPA_VERSION */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t ub_txg; /* txg of last sync */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t ub_guid_sum; /* sum of all vdev guids */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t ub_timestamp; /* UTC time of last sync */
fa9e4066f08beec538e775443c5be79dd423fcabahrens blkptr_t ub_rootbp; /* MOS objset_phys_t */
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Ling
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Ling /* highest SPA_VERSION supported by software that wrote this txg */
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Ling uint64_t ub_software_version;
fa9e4066f08beec538e775443c5be79dd423fcabahrens};
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifdef __cplusplus
fa9e4066f08beec538e775443c5be79dd423fcabahrens}
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* _SYS_UBERBLOCK_IMPL_H */