cg_link => cg_firstfield; fs_link => fs_firstfield
[unix-history] / usr / src / sbin / fsck / setup.c
index f8ff79e..fa6899f 100644 (file)
@@ -1,12 +1,12 @@
 /*
 /*
- * Copyright (c) 1980, 1986 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1986, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)setup.c    5.43 (Berkeley) %G%";
+static char sccsid[] = "@(#)setup.c    8.4 (Berkeley) %G%";
 #endif /* not lint */
 
 #define DKTYPENAMES
 #endif /* not lint */
 
 #define DKTYPENAMES
@@ -28,20 +28,6 @@ struct bufarea asblk;
 #define altsblock (*asblk.b_un.b_fs)
 #define POWEROF2(num)  (((num) & ((num) - 1)) == 0)
 
 #define altsblock (*asblk.b_un.b_fs)
 #define POWEROF2(num)  (((num) & ((num) - 1)) == 0)
 
-/*
- * The size of a cylinder group is calculated by CGSIZE. The maximum size
- * is limited by the fact that cylinder groups are at most one block.
- * Its size is derived from the size of the maps maintained in the 
- * cylinder group and the (struct cg) size.
- */
-#define CGSIZE(fs) \
-    /* base cg */      (sizeof(struct cg) + \
-    /* blktot size */  (fs)->fs_cpg * sizeof(long) + \
-    /* blks size */    (fs)->fs_cpg * (fs)->fs_nrpos * sizeof(short) + \
-    /* inode map */    howmany((fs)->fs_ipg, NBBY) + \
-    /* block map */    howmany((fs)->fs_cpg * (fs)->fs_spc / NSPF(fs), NBBY))
-
-char   *index();
 struct disklabel *getdisklabel();
 
 setup(dev)
 struct disklabel *getdisklabel();
 
 setup(dev)
@@ -194,9 +180,9 @@ setup(dev)
                sblock.fs_nrpos = 8;
                sblock.fs_postbloff =
                    (char *)(&sblock.fs_opostbl[0][0]) -
                sblock.fs_nrpos = 8;
                sblock.fs_postbloff =
                    (char *)(&sblock.fs_opostbl[0][0]) -
-                   (char *)(&sblock.fs_link);
+                   (char *)(&sblock.fs_firstfield);
                sblock.fs_rotbloff = &sblock.fs_space[0] -
                sblock.fs_rotbloff = &sblock.fs_space[0] -
-                   (u_char *)(&sblock.fs_link);
+                   (u_char *)(&sblock.fs_firstfield);
                sblock.fs_cgsize =
                        fragroundup(&sblock, CGSIZE(&sblock));
                sbdirty();
                sblock.fs_cgsize =
                        fragroundup(&sblock, CGSIZE(&sblock));
                sbdirty();
@@ -318,8 +304,6 @@ readsb(listerr)
        getblk(&asblk, cgsblock(&sblock, sblock.fs_ncg - 1), sblock.fs_sbsize);
        if (asblk.b_errs)
                return (0);
        getblk(&asblk, cgsblock(&sblock, sblock.fs_ncg - 1), sblock.fs_sbsize);
        if (asblk.b_errs)
                return (0);
-       altsblock.fs_link = sblock.fs_link;
-       altsblock.fs_rlink = sblock.fs_rlink;
        altsblock.fs_time = sblock.fs_time;
        altsblock.fs_cstotal = sblock.fs_cstotal;
        altsblock.fs_cgrotor = sblock.fs_cgrotor;
        altsblock.fs_time = sblock.fs_time;
        altsblock.fs_cstotal = sblock.fs_cstotal;
        altsblock.fs_cgrotor = sblock.fs_cgrotor;
@@ -345,6 +329,7 @@ readsb(listerr)
        altsblock.fs_interleave = sblock.fs_interleave;
        altsblock.fs_npsect = sblock.fs_npsect;
        altsblock.fs_nrpos = sblock.fs_nrpos;
        altsblock.fs_interleave = sblock.fs_interleave;
        altsblock.fs_npsect = sblock.fs_npsect;
        altsblock.fs_nrpos = sblock.fs_nrpos;
+       altsblock.fs_state = sblock.fs_state;
        altsblock.fs_qbmask = sblock.fs_qbmask;
        altsblock.fs_qfmask = sblock.fs_qfmask;
        altsblock.fs_state = sblock.fs_state;
        altsblock.fs_qbmask = sblock.fs_qbmask;
        altsblock.fs_qfmask = sblock.fs_qfmask;
        altsblock.fs_state = sblock.fs_state;