]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Ported to Linux's Second Extended File System as part of the | |
3 | * dump and restore backup suit | |
4 | * Remy Card <card@Linux.EU.Org>, 1994, 1995, 1996 | |
5 | * | |
6 | */ | |
7 | ||
8 | /* | |
9 | * Copyright (c) 1980, 1993 | |
10 | * The Regents of the University of California. All rights reserved. | |
11 | * (c) UNIX System Laboratories, Inc. | |
12 | * All or some portions of this file are derived from material licensed | |
13 | * to the University of California by American Telephone and Telegraph | |
14 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | |
15 | * the permission of UNIX System Laboratories, Inc. | |
16 | * | |
17 | * Redistribution and use in source and binary forms, with or without | |
18 | * modification, are permitted provided that the following conditions | |
19 | * are met: | |
20 | * 1. Redistributions of source code must retain the above copyright | |
21 | * notice, this list of conditions and the following disclaimer. | |
22 | * 2. Redistributions in binary form must reproduce the above copyright | |
23 | * notice, this list of conditions and the following disclaimer in the | |
24 | * documentation and/or other materials provided with the distribution. | |
25 | * 3. All advertising materials mentioning features or use of this software | |
26 | * must display the following acknowledgement: | |
27 | * This product includes software developed by the University of | |
28 | * California, Berkeley and its contributors. | |
29 | * 4. Neither the name of the University nor the names of its contributors | |
30 | * may be used to endorse or promote products derived from this software | |
31 | * without specific prior written permission. | |
32 | * | |
33 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
34 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
35 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
36 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
37 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
38 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
39 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
40 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
41 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
42 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
43 | * SUCH DAMAGE. | |
44 | * | |
45 | * @(#)dumprestore.h 8.2 (Berkeley) 1/21/94 | |
46 | */ | |
47 | ||
48 | #ifndef _DUMPRESTORE_H_ | |
49 | #define _DUMPRESTORE_H_ | |
50 | ||
51 | /* | |
52 | * TP_BSIZE is the size of file blocks on the dump tapes. | |
53 | * Note that TP_BSIZE must be a multiple of DEV_BSIZE. | |
54 | * | |
55 | * NTREC is the number of TP_BSIZE blocks that are written | |
56 | * in each tape record. HIGHDENSITYTREC is the number of | |
57 | * TP_BSIZE blocks that are written in each tape record on | |
58 | * 6250 BPI or higher density tapes. | |
59 | * | |
60 | * TP_NINDIR is the number of indirect pointers in a TS_INODE | |
61 | * or TS_ADDR record. Note that it must be a power of two. | |
62 | */ | |
63 | #define TP_BSIZE 1024 | |
64 | #define NTREC 10 | |
65 | #define HIGHDENSITYTREC 32 | |
66 | #define TP_NINDIR (TP_BSIZE/2) | |
67 | #define LBLSIZE 16 | |
68 | #define NAMELEN 64 | |
69 | ||
70 | #define OFS_MAGIC (int)60011 | |
71 | #define NFS_MAGIC (int)60012 | |
72 | #define CHECKSUM (int)84446 | |
73 | ||
74 | union u_spcl { | |
75 | char dummy[TP_BSIZE]; | |
76 | struct s_spcl { | |
77 | __s32 c_type; /* record type (see below) */ | |
78 | __u32 c_date; /* date of this dump */ | |
79 | __u32 c_ddate; /* date of previous dump */ | |
80 | __s32 c_volume; /* dump volume number */ | |
81 | daddr_t c_tapea; /* logical block of this record */ | |
82 | ino_t c_inumber; /* number of inode */ | |
83 | __s32 c_magic; /* magic number (see above) */ | |
84 | __s32 c_checksum; /* record checksum */ | |
85 | #ifdef __linux__ | |
86 | struct new_bsd_inode c_dinode; | |
87 | #else | |
88 | struct dinode c_dinode; /* ownership and mode of inode */ | |
89 | #endif | |
90 | __s32 c_count; /* number of valid c_addr entries */ | |
91 | char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */ | |
92 | char c_label[LBLSIZE]; /* dump label */ | |
93 | __s32 c_level; /* level of this dump */ | |
94 | char c_filesys[NAMELEN]; /* name of dumpped file system */ | |
95 | char c_dev[NAMELEN]; /* name of dumpped device */ | |
96 | char c_host[NAMELEN]; /* name of dumpped host */ | |
97 | __s32 c_flags; /* additional information */ | |
98 | __s32 c_firstrec; /* first record on volume */ | |
99 | __s32 c_spare[32]; /* reserved for future uses */ | |
100 | } s_spcl; | |
101 | } u_spcl; | |
102 | #define spcl u_spcl.s_spcl | |
103 | /* | |
104 | * special record types | |
105 | */ | |
106 | #define TS_TAPE 1 /* dump tape header */ | |
107 | #define TS_INODE 2 /* beginning of file record */ | |
108 | #define TS_ADDR 4 /* continuation of file record */ | |
109 | #define TS_BITS 3 /* map of inodes on tape */ | |
110 | #define TS_CLRI 6 /* map of inodes deleted since last dump */ | |
111 | #define TS_END 5 /* end of volume marker */ | |
112 | ||
113 | /* | |
114 | * flag values | |
115 | */ | |
116 | #define DR_NEWHEADER 0x0001 /* new format tape header */ | |
117 | #define DR_NEWINODEFMT 0x0002 /* new format inodes on tape */ | |
118 | ||
119 | #define DUMPOUTFMT "%-16s %c %s" /* for printf */ | |
120 | /* name, level, ctime(date) */ | |
121 | #define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */ | |
122 | ||
123 | #endif /* !_DUMPRESTORE_H_ */ |