dumprestore.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T. */
/* All rights reserved. */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
#ifndef _PROTOCOLS_DUMPRESTORE_H
#define _PROTOCOLS_DUMPRESTORE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* This header file defines two different versions of the
* ufsdump/ufsrestore interface. If the defined constant
* SUPPORTS_MTB_TAPE_FORMAT is set, the data structures in
* this header file will support backups of more than 2 terabytes
* of data.
*
* In the old format (the format that only supports dumps
* of less than 2 terabytes), TP_BSIZE is the size of file blocks
* on the dump tapes.
* Note that TP_BSIZE must be a multiple of DEV_BSIZE.
*
* In the new format, tp_bsize is used to store the
* tape block size, which is variable. The tape block size
* is like 'fragsize', in that 'c_tapea' in each tape record
* contains the 'tape block record' number in a signed int.
* We set TP_BSIZE_MAX to 65536, which will handle 128TB
* of data. The new format is indicated by a magic number
* in the tape header of MTB_MAGIC. The new format is only
* used when the size of the backup exceeds 2 TB. If the
* backup can be stored in less thatn 2 TB, ufsdump still
* uses the format indicated by the NFS_MAGIC magic number.
* Therefore, backups of less than 2 TB are still readable
* by earlier versions of ufsrestore.
*
* NTREC is the number of TP_BSIZE blocks that are written
* in each tape record. HIGHDENSITYTREC is the number of
* TP_BSIZE blocks that are written in each tape record on
* 6250 BPI or higher density tapes. CARTRIDGETREC is the
* number of TP_BSIZE (or tp_bsize) blocks that are written
* in each tape record on cartridge tapes.
*
* TP_NINDIR is the number of indirect pointers in a TS_INODE
* or TS_ADDR record. Note that it must be a power of two.
*
*/
#define TP_BSIZE_MAX 65536
#define TP_BSIZE_MIN 1024
#ifdef SUPPORTS_MTB_TAPE_FORMAT
#define TP_BUFSIZE TP_BSIZE_MAX
#else
#define TP_BSIZE 1024
#define TP_BUFSIZE TP_BSIZE
#endif /* SUPPORTS_MTB_TAPE_FORMAT */
#define NTREC 10
#define HIGHDENSITYTREC 32
#define CARTRIDGETREC 63
#define LBLSIZE 16
#define NAMELEN 64
#define OFS_MAGIC (int)60011
#define NFS_MAGIC (int)60012
#define MTB_MAGIC (int)60013
#define CHECKSUM (int)84446
union u_data {
};
union u_shadow {
struct s_nonsh {
} c_nonsh;
char c_shadow[1];
};
/* if you change anything here, be sure to change normspcl in byteorder.c */
union u_spcl {
char dummy[TP_BUFSIZE];
struct s_spcl {
#ifdef SUPPORTS_MTB_TAPE_FORMAT
#else
#endif /* SUPPORTS_MTB_TAPE_FORMAT */
} s_spcl;
} u_spcl;
/*
* special record types
*/
/*
* flag values
*/
/* name, incno, ctime(date) */
#ifdef __cplusplus
}
#endif
#endif /* !_PROTOCOLS_DUMPRESTORE_H */