uberblock_impl.h revision 323759
190868Smike/*
280708Sjake * CDDL HEADER START
380708Sjake *
480708Sjake * The contents of this file are subject to the terms of the
580708Sjake * Common Development and Distribution License (the "License").
680708Sjake * You may not use this file except in compliance with the License.
780708Sjake *
880708Sjake * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
980708Sjake * or http://www.opensolaris.org/os/licensing.
1080708Sjake * See the License for the specific language governing permissions
1180708Sjake * and limitations under the License.
1280708Sjake *
1390868Smike * When distributing Covered Code, include this CDDL HEADER in each
1490868Smike * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1590868Smike * If applicable, add the following below this CDDL HEADER, with the
1680708Sjake * fields enclosed by brackets "[]" replaced with your own identifying
1780708Sjake * information: Portions Copyright [yyyy] [name of copyright owner]
1880708Sjake *
1980708Sjake * CDDL HEADER END
2080708Sjake */
2180708Sjake/*
2280708Sjake * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2380708Sjake * Copyright (c) 2017 by Delphix. All rights reserved.
2480708Sjake */
2580708Sjake
2680708Sjake#ifndef _SYS_UBERBLOCK_IMPL_H
2780708Sjake#define	_SYS_UBERBLOCK_IMPL_H
2880708Sjake
2980708Sjake#include <sys/uberblock.h>
3080708Sjake
3180708Sjake#ifdef	__cplusplus
3280708Sjakeextern "C" {
3380708Sjake#endif
3480708Sjake
3580708Sjake/*
3694512Smike * The uberblock version is incremented whenever an incompatible on-disk
37102227Smike * format change is made to the SPA, DMU, or ZAP.
3890868Smike *
3980708Sjake * Note: the first two fields should never be moved.  When a storage pool
4080708Sjake * is opened, the uberblock must be read off the disk before the version
4180708Sjake * can be checked.  If the ub_version field is moved, we may not detect
4296672Sobrien * version mismatch.  If the ub_magic field is moved, applications that
4396672Sobrien * expect the magic number in the first word won't work.
4480708Sjake */
4580708Sjake#define	UBERBLOCK_MAGIC		0x00bab10c		/* oo-ba-bloc!	*/
4680708Sjake#define	UBERBLOCK_SHIFT		10			/* up to 1K	*/
4780708Sjake
4880708Sjakestruct uberblock {
4994362Smike	uint64_t	ub_magic;	/* UBERBLOCK_MAGIC		*/
5094362Smike	uint64_t	ub_version;	/* SPA_VERSION			*/
5194362Smike	uint64_t	ub_txg;		/* txg of last sync		*/
5280708Sjake	uint64_t	ub_guid_sum;	/* sum of all vdev guids	*/
5394362Smike	uint64_t	ub_timestamp;	/* UTC time of last sync	*/
5480708Sjake	blkptr_t	ub_rootbp;	/* MOS objset_phys_t		*/
5594362Smike
5694362Smike	/* highest SPA_VERSION supported by software that wrote this txg */
5794362Smike	uint64_t	ub_software_version;
5894362Smike
5994362Smike	/* These fields are reserved for features that are under development: */
6094362Smike	uint64_t	ub_mmp_magic;
6194362Smike	uint64_t	ub_mmp_delay;
6294362Smike	uint64_t	ub_mmp_seq;
6394362Smike	uint64_t	ub_checkpoint_txg;
6494362Smike};
6594362Smike
66143063Sjoerg#ifdef	__cplusplus
67120611Smux}
68120611Smux#endif
69120611Smux
70120611Smux#endif	/* _SYS_UBERBLOCK_IMPL_H */
7191959Smike