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