config.h revision 1.1 1 1.1 perseant /* $NetBSD: config.h,v 1.1 1999/03/18 17:18:05 perseant Exp $ */
2 1.1 perseant
3 1.1 perseant /*-
4 1.1 perseant * Copyright (c) 1991, 1993
5 1.1 perseant * The Regents of the University of California. All rights reserved.
6 1.1 perseant *
7 1.1 perseant * Redistribution and use in source and binary forms, with or without
8 1.1 perseant * modification, are permitted provided that the following conditions
9 1.1 perseant * are met:
10 1.1 perseant * 1. Redistributions of source code must retain the above copyright
11 1.1 perseant * notice, this list of conditions and the following disclaimer.
12 1.1 perseant * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 perseant * notice, this list of conditions and the following disclaimer in the
14 1.1 perseant * documentation and/or other materials provided with the distribution.
15 1.1 perseant * 3. All advertising materials mentioning features or use of this software
16 1.1 perseant * must display the following acknowledgement:
17 1.1 perseant * This product includes software developed by the University of
18 1.1 perseant * California, Berkeley and its contributors.
19 1.1 perseant * 4. Neither the name of the University nor the names of its contributors
20 1.1 perseant * may be used to endorse or promote products derived from this software
21 1.1 perseant * without specific prior written permission.
22 1.1 perseant *
23 1.1 perseant * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 1.1 perseant * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 1.1 perseant * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 1.1 perseant * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 1.1 perseant * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 1.1 perseant * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 1.1 perseant * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 1.1 perseant * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 1.1 perseant * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 1.1 perseant * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 1.1 perseant * SUCH DAMAGE.
34 1.1 perseant *
35 1.1 perseant * @(#)config.h 8.3 (Berkeley) 5/24/95
36 1.1 perseant */
37 1.1 perseant
38 1.1 perseant /*
39 1.1 perseant * The first boot and super blocks are given in absolute disk addresses.
40 1.1 perseant * The byte-offset forms are preferred, as they don't imply a sector size.
41 1.1 perseant */
42 1.1 perseant #define BBSIZE 8192
43 1.1 perseant #define SBSIZE 8192
44 1.1 perseant
45 1.1 perseant /*
46 1.1 perseant * The following two constants set the default block and fragment sizes.
47 1.1 perseant * Both constants must be a power of 2 and meet the following constraints:
48 1.1 perseant * MINBSIZE <= DESBLKSIZE <= MAXBSIZE
49 1.1 perseant * sectorsize <= DESFRAGSIZE <= DESBLKSIZE
50 1.1 perseant * DESBLKSIZE / DESFRAGSIZE <= 8
51 1.1 perseant */
52 1.1 perseant #define DFL_FRAGSIZE 1024
53 1.1 perseant #define DFL_BLKSIZE 8192
54 1.1 perseant
55 1.1 perseant /*
56 1.1 perseant * Cylinder groups may have up to many cylinders. The actual
57 1.1 perseant * number used depends upon how much information can be stored
58 1.1 perseant * on a single cylinder. The default is to use 16 cylinders
59 1.1 perseant * per group.
60 1.1 perseant */
61 1.1 perseant #define DESCPG 16 /* desired fs_cpg */
62 1.1 perseant
63 1.1 perseant /*
64 1.1 perseant * MINFREE gives the minimum acceptable percentage of file system
65 1.1 perseant * blocks which may be free. If the freelist drops below this level
66 1.1 perseant * only the superuser may continue to allocate blocks. This may
67 1.1 perseant * be set to 0 if no reserve of free blocks is deemed necessary,
68 1.1 perseant * however throughput drops by fifty percent if the file system
69 1.1 perseant * is run at between 90% and 100% full; thus the default value of
70 1.1 perseant * fs_minfree is 10%. With 10% free space, fragmentation is not a
71 1.1 perseant * problem, so we choose to optimize for time.
72 1.1 perseant */
73 1.1 perseant #define MINFREE 10
74 1.1 perseant #define DEFAULTOPT FS_OPTTIME
75 1.1 perseant
76 1.1 perseant /*
77 1.1 perseant * Preference for optimization.
78 1.1 perseant */
79 1.1 perseant #define FS_OPTTIME 0 /* minimize allocation time */
80 1.1 perseant #define FS_OPTSPACE 1 /* minimize disk fragmentation */
81 1.1 perseant
82 1.1 perseant
83 1.1 perseant /*
84 1.1 perseant * ROTDELAY gives the minimum number of milliseconds to initiate
85 1.1 perseant * another disk transfer on the same cylinder. It is used in
86 1.1 perseant * determining the rotationally optimal layout for disk blocks
87 1.1 perseant * within a file; the default of fs_rotdelay is 4ms.
88 1.1 perseant */
89 1.1 perseant #define ROTDELAY 4
90 1.1 perseant
91 1.1 perseant /*
92 1.1 perseant * MAXCONTIG sets the default for the maximum number of blocks
93 1.1 perseant * that may be allocated sequentially. Since UNIX drivers are
94 1.1 perseant * not capable of scheduling multi-block transfers, this defaults
95 1.1 perseant * to 1 (ie no contiguous blocks are allocated).
96 1.1 perseant */
97 1.1 perseant #define MAXCONTIG 1
98 1.1 perseant
99 1.1 perseant /*
100 1.1 perseant * MAXBLKPG determines the maximum number of data blocks which are
101 1.1 perseant * placed in a single cylinder group. The default is one indirect
102 1.1 perseant * block worth of data blocks.
103 1.1 perseant */
104 1.1 perseant #define MAXBLKPG(bsize) ((bsize) / sizeof(daddr_t))
105 1.1 perseant
106 1.1 perseant /*
107 1.1 perseant * Each file system has a number of inodes statically allocated.
108 1.1 perseant * We allocate one inode slot per NFPI fragments, expecting this
109 1.1 perseant * to be far more than we will ever need.
110 1.1 perseant */
111 1.1 perseant #define NFPI 4
112 1.1 perseant
113 1.1 perseant /*
114 1.1 perseant * For each cylinder we keep track of the availability of blocks at different
115 1.1 perseant * rotational positions, so that we can lay out the data to be picked
116 1.1 perseant * up with minimum rotational latency. NRPOS is the default number of
117 1.1 perseant * rotational positions that we distinguish. With NRPOS of 8 the resolution
118 1.1 perseant * of our summary information is 2ms for a typical 3600 rpm drive.
119 1.1 perseant */
120 1.1 perseant #define NRPOS 8 /* number distinct rotational positions */
121 1.1 perseant
122 1.1 perseant /*
123 1.1 perseant * The following constants set the default block and segment size for a log
124 1.1 perseant * structured file system. Both must be powers of two and the segment size
125 1.1 perseant * must be a multiple of the block size. We also set minimum block and segment
126 1.1 perseant * sizes.
127 1.1 perseant */
128 1.1 perseant #define LFS_MINSEGSIZE (64*1024)
129 1.1 perseant #define DFL_LFSSEG (1024 * 1024)
130 1.1 perseant #define DFL_LFSSEG_SHIFT 20
131 1.1 perseant #define DFL_LFSSEG_MASK 0xFFFFF
132 1.1 perseant
133 1.1 perseant #define LFS_MINBLOCKSIZE 512
134 1.1 perseant #define DFL_LFSBLOCK 8192
135 1.1 perseant #define DFL_LFSBLOCK_SHIFT 13
136 1.1 perseant #define DFL_LFSBLOCK_MASK 0x1FFF
137 1.1 perseant
138 1.1 perseant #define DFL_LFSFRAG 1024
139 1.1 perseant #define DFL_LFS_FFMASK 0x3FF
140 1.1 perseant #define DFL_LFS_FFSHIFT 10
141 1.1 perseant #define DFL_LFS_FBMASK 0x7
142 1.1 perseant #define DFL_LFS_FBSHIFT 3
143