xref: /onnv-gate/usr/src/uts/common/fs/zfs/sys/uberblock_impl.h (revision 12296:7cf402a7f374)
1789Sahrens /*
2789Sahrens  * CDDL HEADER START
3789Sahrens  *
4789Sahrens  * The contents of this file are subject to the terms of the
51732Sbonwick  * Common Development and Distribution License (the "License").
61732Sbonwick  * You may not use this file except in compliance with the License.
7789Sahrens  *
8789Sahrens  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9789Sahrens  * or http://www.opensolaris.org/os/licensing.
10789Sahrens  * See the License for the specific language governing permissions
11789Sahrens  * and limitations under the License.
12789Sahrens  *
13789Sahrens  * When distributing Covered Code, include this CDDL HEADER in each
14789Sahrens  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15789Sahrens  * If applicable, add the following below this CDDL HEADER, with the
16789Sahrens  * fields enclosed by brackets "[]" replaced with your own identifying
17789Sahrens  * information: Portions Copyright [yyyy] [name of copyright owner]
18789Sahrens  *
19789Sahrens  * CDDL HEADER END
20789Sahrens  */
21789Sahrens /*
22*12296SLin.Ling@Sun.COM  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23789Sahrens  */
24789Sahrens 
25789Sahrens #ifndef _SYS_UBERBLOCK_IMPL_H
26789Sahrens #define	_SYS_UBERBLOCK_IMPL_H
27789Sahrens 
28789Sahrens #include <sys/uberblock.h>
29789Sahrens 
30789Sahrens #ifdef	__cplusplus
31789Sahrens extern "C" {
32789Sahrens #endif
33789Sahrens 
34789Sahrens /*
35789Sahrens  * The uberblock version is incremented whenever an incompatible on-disk
36789Sahrens  * format change is made to the SPA, DMU, or ZAP.
37789Sahrens  *
38789Sahrens  * Note: the first two fields should never be moved.  When a storage pool
39789Sahrens  * is opened, the uberblock must be read off the disk before the version
40789Sahrens  * can be checked.  If the ub_version field is moved, we may not detect
41789Sahrens  * version mismatch.  If the ub_magic field is moved, applications that
42789Sahrens  * expect the magic number in the first word won't work.
43789Sahrens  */
44789Sahrens #define	UBERBLOCK_MAGIC		0x00bab10c		/* oo-ba-bloc!	*/
451732Sbonwick #define	UBERBLOCK_SHIFT		10			/* up to 1K	*/
46789Sahrens 
47789Sahrens struct uberblock {
48789Sahrens 	uint64_t	ub_magic;	/* UBERBLOCK_MAGIC		*/
494577Sahrens 	uint64_t	ub_version;	/* SPA_VERSION			*/
50789Sahrens 	uint64_t	ub_txg;		/* txg of last sync		*/
51789Sahrens 	uint64_t	ub_guid_sum;	/* sum of all vdev guids	*/
52789Sahrens 	uint64_t	ub_timestamp;	/* UTC time of last sync	*/
53789Sahrens 	blkptr_t	ub_rootbp;	/* MOS objset_phys_t		*/
54*12296SLin.Ling@Sun.COM 
55*12296SLin.Ling@Sun.COM 	/* highest SPA_VERSION supported by software that wrote this txg */
56*12296SLin.Ling@Sun.COM 	uint64_t	ub_software_version;
57789Sahrens };
58789Sahrens 
59789Sahrens #ifdef	__cplusplus
60789Sahrens }
61789Sahrens #endif
62789Sahrens 
63789Sahrens #endif	/* _SYS_UBERBLOCK_IMPL_H */
64