build filesystems with new format inodes
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 3 Jul 1992 08:46:11 +0000 (00:46 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 3 Jul 1992 08:46:11 +0000 (00:46 -0800)
SCCS-vsn: sbin/newfs/mkfs.c 6.27

usr/src/sbin/newfs/mkfs.c

index 7dfafcd..0aff6ba 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)mkfs.c     6.26 (Berkeley) %G%";
+static char sccsid[] = "@(#)mkfs.c     6.27 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <unistd.h>
 #endif /* not lint */
 
 #include <unistd.h>
@@ -144,6 +144,8 @@ mkfs(pp, fsys, fi, fo)
        }
        fsi = fi;
        fso = fo;
        }
        fsi = fi;
        fso = fo;
+       sblock.fs_inodefmt = FS_44INODEFMT;
+       sblock.fs_maxsymlinklen = MAXSYMLINKLEN;
        /*
         * Validate the given file system size.
         * Verify that its last block can actually be accessed.
        /*
         * Validate the given file system size.
         * Verify that its last block can actually be accessed.
@@ -735,17 +737,17 @@ struct dinode node;
 #endif
 
 struct direct root_dir[] = {
 #endif
 
 struct direct root_dir[] = {
-       { ROOTINO, sizeof(struct direct), 1, "." },
-       { ROOTINO, sizeof(struct direct), 2, ".." },
+       { ROOTINO, sizeof(struct direct), DT_DIR, 1, "." },
+       { ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
 #ifdef LOSTDIR
 #ifdef LOSTDIR
-       { LOSTFOUNDINO, sizeof(struct direct), 10, "lost+found" },
+       { LOSTFOUNDINO, sizeof(struct direct), DT_DIR, 10, "lost+found" },
 #endif
 };
 #ifdef LOSTDIR
 struct direct lost_found_dir[] = {
 #endif
 };
 #ifdef LOSTDIR
 struct direct lost_found_dir[] = {
-       { LOSTFOUNDINO, sizeof(struct direct), 1, "." },
-       { ROOTINO, sizeof(struct direct), 2, ".." },
-       { 0, DIRBLKSIZ, 0, 0 },
+       { LOSTFOUNDINO, sizeof(struct direct), DT_DIR, 1, "." },
+       { ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
+       { 0, DIRBLKSIZ, 0, 0, 0 },
 };
 #endif
 char buf[MAXBSIZE];
 };
 #endif
 char buf[MAXBSIZE];
@@ -767,7 +769,8 @@ fsinit(utime)
         */
        (void)makedir(lost_found_dir, 2);
        for (i = DIRBLKSIZ; i < sblock.fs_bsize; i += DIRBLKSIZ)
         */
        (void)makedir(lost_found_dir, 2);
        for (i = DIRBLKSIZ; i < sblock.fs_bsize; i += DIRBLKSIZ)
-               bcopy(&lost_found_dir[2], &buf[i], DIRSIZ(&lost_found_dir[2]));
+               bcopy(&lost_found_dir[2], &buf[i],
+                   DIRSIZ(0, &lost_found_dir[2]));
        node.di_mode = IFDIR | UMASK;
        node.di_nlink = 2;
        node.di_size = sblock.fs_bsize;
        node.di_mode = IFDIR | UMASK;
        node.di_nlink = 2;
        node.di_size = sblock.fs_bsize;
@@ -804,13 +807,13 @@ makedir(protodir, entries)
 
        spcleft = DIRBLKSIZ;
        for (cp = buf, i = 0; i < entries - 1; i++) {
 
        spcleft = DIRBLKSIZ;
        for (cp = buf, i = 0; i < entries - 1; i++) {
-               protodir[i].d_reclen = DIRSIZ(&protodir[i]);
+               protodir[i].d_reclen = DIRSIZ(0, &protodir[i]);
                bcopy(&protodir[i], cp, protodir[i].d_reclen);
                cp += protodir[i].d_reclen;
                spcleft -= protodir[i].d_reclen;
        }
        protodir[i].d_reclen = spcleft;
                bcopy(&protodir[i], cp, protodir[i].d_reclen);
                cp += protodir[i].d_reclen;
                spcleft -= protodir[i].d_reclen;
        }
        protodir[i].d_reclen = spcleft;
-       bcopy(&protodir[i], cp, DIRSIZ(&protodir[i]));
+       bcopy(&protodir[i], cp, DIRSIZ(0, &protodir[i]));
        return (DIRBLKSIZ);
 }
 
        return (DIRBLKSIZ);
 }