checkpoint of hacking for mail.cs.berkeley.edu
[unix-history] / usr / src / sbin / newfs / mkfs.c
index 5854134..ef5113e 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)mkfs.c     6.16 (Berkeley) %G%";
+static char sccsid[] = "@(#)mkfs.c     6.19 (Berkeley) %G%";
 #endif /* not lint */
 
 #ifndef STANDALONE
 #endif /* not lint */
 
 #ifndef STANDALONE
@@ -18,11 +18,10 @@ static char sccsid[] = "@(#)mkfs.c  6.16 (Berkeley) %G%";
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/resource.h>
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/resource.h>
-#include <ufs/dinode.h>
-#include <ufs/fs.h>
-#include <ufs/dir.h>
+#include <ufs/ufs/dinode.h>
+#include <ufs/ufs/dir.h>
+#include <ufs/ffs/fs.h>
 #include <sys/disklabel.h>
 #include <sys/disklabel.h>
-#include <machine/endian.h>
 
 /*
  * make file system for cylinder-group style file systems
 
 /*
  * make file system for cylinder-group style file systems
@@ -103,7 +102,6 @@ union {
 struct dinode zino[MAXBSIZE / sizeof(struct dinode)];
 
 int    fsi, fso;
 struct dinode zino[MAXBSIZE / sizeof(struct dinode)];
 
 int    fsi, fso;
-time_t utime;
 daddr_t        alloc();
 
 mkfs(pp, fsys, fi, fo)
 daddr_t        alloc();
 
 mkfs(pp, fsys, fi, fo)
@@ -117,6 +115,7 @@ mkfs(pp, fsys, fi, fo)
        long mapcramped, inodecramped;
        long postblsize, rotblsize, totalsbsize;
        int ppid, status;
        long mapcramped, inodecramped;
        long postblsize, rotblsize, totalsbsize;
        int ppid, status;
+       time_t utime;
        void started();
 
 #ifndef STANDALONE
        void started();
 
 #ifndef STANDALONE
@@ -566,7 +565,7 @@ next:
        if (!mfs)
                printf("super-block backups (for fsck -b #) at:");
        for (cylno = 0; cylno < sblock.fs_ncg; cylno++) {
        if (!mfs)
                printf("super-block backups (for fsck -b #) at:");
        for (cylno = 0; cylno < sblock.fs_ncg; cylno++) {
-               initcg(cylno);
+               initcg(cylno, utime);
                if (mfs)
                        continue;
                if (cylno % 9 == 0)
                if (mfs)
                        continue;
                if (cylno % 9 == 0)
@@ -581,7 +580,7 @@ next:
         * Now construct the initial file system,
         * then write out the super-block.
         */
         * Now construct the initial file system,
         * then write out the super-block.
         */
-       fsinit();
+       fsinit(utime);
        sblock.fs_time = utime;
        wtfs(SBOFF / sectorsize, sbsize, (char *)&sblock);
        for (i = 0; i < sblock.fs_cssize; i += sblock.fs_bsize)
        sblock.fs_time = utime;
        wtfs(SBOFF / sectorsize, sbsize, (char *)&sblock);
        for (i = 0; i < sblock.fs_cssize; i += sblock.fs_bsize)
@@ -620,8 +619,9 @@ next:
 /*
  * Initialize a cylinder group.
  */
 /*
  * Initialize a cylinder group.
  */
-initcg(cylno)
+initcg(cylno, utime)
        int cylno;
        int cylno;
+       time_t utime;
 {
        daddr_t cbase, d, dlower, dupper, dmax;
        long i, j, s;
 {
        daddr_t cbase, d, dlower, dupper, dmax;
        long i, j, s;
@@ -754,7 +754,8 @@ struct direct lost_found_dir[] = {
 #endif
 char buf[MAXBSIZE];
 
 #endif
 char buf[MAXBSIZE];
 
-fsinit()
+fsinit(utime)
+       time_t utime;
 {
        int i;
 
 {
        int i;
 
@@ -906,6 +907,7 @@ iput(ip, ino)
 /*
  * Notify parent process that the filesystem has created itself successfully.
  */
 /*
  * Notify parent process that the filesystem has created itself successfully.
  */
+void
 started()
 {
 
 started()
 {