xref: /csrg-svn/sbin/newlfs/config.h (revision 61524)
151147Sbostic /*-
2*61524Sbostic  * Copyright (c) 1991, 1993
3*61524Sbostic  *	The Regents of the University of California.  All rights reserved.
451147Sbostic  *
551147Sbostic  * %sccs.include.redist.c%
651147Sbostic  *
7*61524Sbostic  *	@(#)config.h	8.1 (Berkeley) 06/05/93
851147Sbostic  */
951147Sbostic 
1051147Sbostic /*
1151147Sbostic  * The following two constants set the default block and fragment sizes.
1251147Sbostic  * Both constants must be a power of 2 and meet the following constraints:
1351147Sbostic  *	MINBSIZE <= DESBLKSIZE <= MAXBSIZE
1451147Sbostic  *	sectorsize <= DESFRAGSIZE <= DESBLKSIZE
1551147Sbostic  *	DESBLKSIZE / DESFRAGSIZE <= 8
1651147Sbostic  */
1751147Sbostic #define	DFL_FRAGSIZE	1024
1851147Sbostic #define	DFL_BLKSIZE	8192
1951147Sbostic 
2051147Sbostic /*
2151147Sbostic  * Cylinder groups may have up to many cylinders. The actual
2251147Sbostic  * number used depends upon how much information can be stored
2351147Sbostic  * on a single cylinder. The default is to use 16 cylinders
2451147Sbostic  * per group.
2551147Sbostic  */
2651147Sbostic #define	DESCPG		16	/* desired fs_cpg */
2751147Sbostic 
2851147Sbostic /*
2951147Sbostic  * MINFREE gives the minimum acceptable percentage of file system
3051147Sbostic  * blocks which may be free. If the freelist drops below this level
3151147Sbostic  * only the superuser may continue to allocate blocks. This may
3251147Sbostic  * be set to 0 if no reserve of free blocks is deemed necessary,
3351147Sbostic  * however throughput drops by fifty percent if the file system
3451147Sbostic  * is run at between 90% and 100% full; thus the default value of
3551147Sbostic  * fs_minfree is 10%. With 10% free space, fragmentation is not a
3651147Sbostic  * problem, so we choose to optimize for time.
3751147Sbostic  */
3851147Sbostic #define MINFREE		10
3951147Sbostic #define DEFAULTOPT	FS_OPTTIME
4051147Sbostic 
4151147Sbostic /*
4251147Sbostic  * ROTDELAY gives the minimum number of milliseconds to initiate
4351147Sbostic  * another disk transfer on the same cylinder. It is used in
4451147Sbostic  * determining the rotationally optimal layout for disk blocks
4551147Sbostic  * within a file; the default of fs_rotdelay is 4ms.
4651147Sbostic  */
4751147Sbostic #define ROTDELAY	4
4851147Sbostic 
4951147Sbostic /*
5051147Sbostic  * MAXCONTIG sets the default for the maximum number of blocks
5151147Sbostic  * that may be allocated sequentially. Since UNIX drivers are
5251147Sbostic  * not capable of scheduling multi-block transfers, this defaults
5351147Sbostic  * to 1 (ie no contiguous blocks are allocated).
5451147Sbostic  */
5551147Sbostic #define MAXCONTIG	1
5651147Sbostic 
5751147Sbostic /*
5851147Sbostic  * MAXBLKPG determines the maximum number of data blocks which are
5951147Sbostic  * placed in a single cylinder group. The default is one indirect
6051147Sbostic  * block worth of data blocks.
6151147Sbostic  */
6251147Sbostic #define MAXBLKPG(bsize)	((bsize) / sizeof(daddr_t))
6351147Sbostic 
6451147Sbostic /*
6551147Sbostic  * Each file system has a number of inodes statically allocated.
6651147Sbostic  * We allocate one inode slot per NFPI fragments, expecting this
6751147Sbostic  * to be far more than we will ever need.
6851147Sbostic  */
6951147Sbostic #define	NFPI		4
7051147Sbostic 
7151147Sbostic /*
7251147Sbostic  * For each cylinder we keep track of the availability of blocks at different
7351147Sbostic  * rotational positions, so that we can lay out the data to be picked
7451147Sbostic  * up with minimum rotational latency.  NRPOS is the default number of
7551147Sbostic  * rotational positions that we distinguish.  With NRPOS of 8 the resolution
7651147Sbostic  * of our summary information is 2ms for a typical 3600 rpm drive.
7751147Sbostic  */
7851147Sbostic #define	NRPOS		8	/* number distinct rotational positions */
7951147Sbostic 
8051147Sbostic /*
8151147Sbostic  * The following constants set the default block and segment size for a log
8251147Sbostic  * structured file system.  Both must be powers of two and the segment size
8351147Sbostic  * must be a multiple of the block size.  We also set minimum block and segment
8451147Sbostic  * sizes.
8551147Sbostic  */
8656862Smargo #define	LFS_MINSEGSIZE		(64*1024)
8751147Sbostic #define	DFL_LFSSEG		(1024 * 1024)
8851147Sbostic #define	DFL_LFSSEG_SHIFT	20
8951863Sbostic #define	DFL_LFSSEG_MASK		0xFFFFF
9051147Sbostic 
9151147Sbostic #define	LFS_MINBLOCKSIZE	1024
9251147Sbostic #define	DFL_LFSBLOCK		4096
9351147Sbostic #define	DFL_LFSBLOCK_SHIFT	12
9454262Sbostic #define	DFL_LFSBLOCK_MASK	0xFFF
95