BSD 4_4_Lite1 release
[unix-history] / usr / src / sys / ufs / ffs / fs.h
index 69ba286..bef052f 100644 (file)
@@ -2,9 +2,35 @@
  * Copyright (c) 1982, 1986, 1993
  *     The Regents of the University of California.  All rights reserved.
  *
  * Copyright (c) 1982, 1986, 1993
  *     The Regents of the University of California.  All rights reserved.
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- *     @(#)fs.h        8.5 (Berkeley) %G%
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)fs.h        8.7 (Berkeley) 4/19/94
  */
 
 /*
  */
 
 /*
  *
  * The first boot and super blocks are given in absolute disk addresses.
  * The byte-offset forms are preferred, as they don't imply a sector size.
  *
  * The first boot and super blocks are given in absolute disk addresses.
  * The byte-offset forms are preferred, as they don't imply a sector size.
- * The byte-offset forms are preferred, as they don't imply a sector size.
  */
 #define BBSIZE         8192
 #define SBSIZE         8192
 #define        BBOFF           ((off_t)(0))
 #define        SBOFF           ((off_t)(BBOFF + BBSIZE))
  */
 #define BBSIZE         8192
 #define SBSIZE         8192
 #define        BBOFF           ((off_t)(0))
 #define        SBOFF           ((off_t)(BBOFF + BBSIZE))
-#define        BBOFF           ((off_t)(0))
-#define        SBOFF           ((off_t)(BBOFF + BBSIZE))
-#ifndef SECSIZE
 #define        BBLOCK          ((daddr_t)(0))
 #define        SBLOCK          ((daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE))
 #define        BBLOCK          ((daddr_t)(0))
 #define        SBLOCK          ((daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE))
-#endif SECSIZE
 
 /*
  * Addresses stored in inodes are capable of addressing fragments
 
 /*
  * Addresses stored in inodes are capable of addressing fragments
  */
 #define FS_MAXCONTIG   16
 
  */
 #define FS_MAXCONTIG   16
 
+/*
+ * MINFREE gives the minimum acceptable percentage of file system
+ * blocks which may be free. If the freelist drops below this level
+ * only the superuser may continue to allocate blocks. This may
+ * be set to 0 if no reserve of free blocks is deemed necessary,
+ * however throughput drops by fifty percent if the file system
+ * is run at between 95% and 100% full; thus the minimum default
+ * value of fs_minfree is 5%. However, to get good clustering
+ * performance, 10% is a better choice. hence we use 10% as our
+ * default value. With 10% free space, fragmentation is not a
+ * problem, so we choose to optimize for time.
+ */
+#define MINFREE                5
+#define DEFAULTOPT     FS_OPTTIME
+
 /*
  * Per cylinder group information; summarized in blocks allocated
  * from first cylinder group data blocks.  These blocks have to be
 /*
  * Per cylinder group information; summarized in blocks allocated
  * from first cylinder group data blocks.  These blocks have to be
@@ -178,8 +214,6 @@ struct fs {
        char    fs_ronly;               /* mounted read-only flag */
        char    fs_flags;               /* currently unused flag */
        char    fs_fsmnt[MAXMNTLEN];    /* name mounted on */
        char    fs_ronly;               /* mounted read-only flag */
        char    fs_flags;               /* currently unused flag */
        char    fs_fsmnt[MAXMNTLEN];    /* name mounted on */
-       long    fs_dbsize;              /* hardware sector size */
-       long    fs_sparecon[31];        /* reserved for future constants */
 /* these fields retain the current block allocation info */
        long    fs_cgrotor;             /* last cg searched */
        struct  csum *fs_csp[MAXCSBUFS];/* list of fs_cs info buffers */
 /* these fields retain the current block allocation info */
        long    fs_cgrotor;             /* last cg searched */
        struct  csum *fs_csp[MAXCSBUFS];/* list of fs_cs info buffers */
@@ -194,7 +228,7 @@ struct fs {
        quad_t  fs_qfmask;              /* ~fs_fmask - for use with quad size */
        long    fs_state;               /* validate fs_clean field */
        long    fs_postblformat;        /* format of positional layout tables */
        quad_t  fs_qfmask;              /* ~fs_fmask - for use with quad size */
        long    fs_state;               /* validate fs_clean field */
        long    fs_postblformat;        /* format of positional layout tables */
-       long    fs_nrpos;               /* number of rotaional positions */
+       long    fs_nrpos;               /* number of rotational positions */
        long    fs_postbloff;           /* (short) rotation block list head */
        long    fs_rotbloff;            /* (u_char) blocks for each rotation */
        long    fs_magic;               /* magic number */
        long    fs_postbloff;           /* (short) rotation block list head */
        long    fs_rotbloff;            /* (u_char) blocks for each rotation */
        long    fs_magic;               /* magic number */