genfth.cf revision 1.2 1 # $NetBSD: genfth.cf,v 1.2 2003/04/03 22:10:12 christos Exp $
2
3 #
4 # Copyright (c) 1997 The NetBSD Foundation, Inc.
5 # All rights reserved.
6 #
7 # This code is derived from software contributed to The NetBSD Foundation
8 # by Christos Zoulas.
9 #
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted provided that the following conditions
12 # are met:
13 # 1. Redistributions of source code must retain the above copyright
14 # notice, this list of conditions and the following disclaimer.
15 # 2. Redistributions in binary form must reproduce the above copyright
16 # notice, this list of conditions and the following disclaimer in the
17 # documentation and/or other materials provided with the distribution.
18 # 3. All advertising materials mentioning features or use of this software
19 # must display the following acknowledgement:
20 # This product includes software developed by the NetBSD
21 # Foundation, Inc. and its contributors.
22 # 4. Neither the name of The NetBSD Foundation nor the names of its
23 # contributors may be used to endorse or promote products derived
24 # from this software without specific prior written permission.
25 #
26 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 # POSSIBILITY OF SUCH DAMAGE.
37 #
38 # Copyright (c) 1992, 1993
39 # The Regents of the University of California. All rights reserved.
40 #
41 # This software was developed by the Computer Systems Engineering group
42 # at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
43 # contributed to Berkeley.
44 #
45 # All advertising materials mentioning features or use of this software
46 # must display the following acknowledgement:
47 # This product includes software developed by the University of
48 # California, Lawrence Berkeley Laboratory.
49 #
50 # Redistribution and use in source and binary forms, with or without
51 # modification, are permitted provided that the following conditions
52 # are met:
53 # 1. Redistributions of source code must retain the above copyright
54 # notice, this list of conditions and the following disclaimer.
55 # 2. Redistributions in binary form must reproduce the above copyright
56 # notice, this list of conditions and the following disclaimer in the
57 # documentation and/or other materials provided with the distribution.
58 # 3. All advertising materials mentioning features or use of this software
59 # must display the following acknowledgement:
60 # This product includes software developed by the University of
61 # California, Berkeley and its contributors.
62 # 4. Neither the name of the University nor the names of its contributors
63 # may be used to endorse or promote products derived from this software
64 # without specific prior written permission.
65 #
66 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
67 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
68 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
69 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
70 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
71 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
72 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
73 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
74 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
75 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
76 # SUCH DAMAGE.
77 #
78 # @(#)genassym.c 8.1 (Berkeley) 6/11/93
79 #
80
81 include <sys/param.h>
82 include <sys/time.h>
83 include <ufs/ufs/dinode.h>
84 include <ufs/ufs/dir.h>
85 include <ufs/ffs/fs.h>
86
87 #
88 # ufs sizing constants
89 #
90 define dev_bsize DEV_BSIZE
91 define maxbsize MAXBSIZE
92 define bbsize BBSIZE
93 define sbsize SBLOCKSIZE
94 define bboff BBOFF
95 define sboff SBOFF
96 define bblock BBLOCK
97 # XXX: Will not work for UFS2!
98 define sblock SBLOCK_UFS1
99
100 #
101 # ufs superblock
102 #
103 struct fs
104 member fs_magic
105 member fs_bsize
106 member fs_npsect
107 member fs_nsect
108 member fs_interleave
109 member fs_postblformat
110 member fs_nrpos
111 member fs_inodefmt
112 member fs_maxfilesize
113 member fs_qbmask
114 member fs_qfmask
115 member fs_bmask
116 member fs_fmask
117 member fs_ipg
118 member fs_fpg
119 member fs_inopb
120 member fs_fragshift
121 member fs_bshift
122 member fs_fshift
123 member fs_cgoffset
124 member fs_cgmask
125 member fs_dblkno
126 member fs_iblkno
127 member fs_sblkno
128 member fs_cblkno
129 member fs_fsbtodb
130 member fs_nindir
131 member fs_frag
132 member fs_maxsymlinklen
133
134 #
135 # ufs dinode
136 #
137 struct dinode
138 member di_size
139 member di_mode
140 member di_db
141 member di_ib
142 member di_shortlink
143
144 #
145 # ufs direct
146 #
147 struct direct
148 member d_ino
149 member d_reclen
150 #member d_type # notused
151 member d_namlen
152 member d_name
153
154 define fs_magic_value FS_MAGIC
155 define fs_42postblfmt FS_42POSTBLFMT
156 define fs_44inodefmt FS_44INODEFMT
157 define ndaddr NDADDR
158 define niaddr NIADDR
159 define rootino ROOTINO
160 define ifmt IFMT
161 define ifdir IFDIR
162 define iflnk IFLNK
163