zero link count table increased 50 => 500; corrupted directories now pfatal.
[unix-history] / usr / src / sbin / dump / traverse.c
index b187de3..849f231 100644 (file)
@@ -1,7 +1,6 @@
-static char *sccsid = "@(#)traverse.c  1.6 (Berkeley) %G%";
+static char *sccsid = "@(#)traverse.c  1.12 (Berkeley) %G%";
 
 #include "dump.h"
 
 #include "dump.h"
-#include <ndir.h>
 
 pass(fn, map)
        int (*fn)();
 
 pass(fn, map)
        int (*fn)();
@@ -41,7 +40,7 @@ mark(ip)
        if ((ip->di_mtime >= spcl.c_ddate || ip->di_ctime >= spcl.c_ddate) &&
            !BIT(ino, nodmap)) {
                BIS(ino, nodmap);
        if ((ip->di_mtime >= spcl.c_ddate || ip->di_ctime >= spcl.c_ddate) &&
            !BIT(ino, nodmap)) {
                BIS(ino, nodmap);
-               if (f != IFREG && f != IFDIR) {
+               if (f != IFREG && f != IFDIR && f != IFLNK) {
                        esize += 1;
                        return;
                }
                        esize += 1;
                        return;
                }
@@ -117,7 +116,7 @@ dump(ip)
        spcl.c_type = TS_INODE;
        spcl.c_count = 0;
        i = ip->di_mode & IFMT;
        spcl.c_type = TS_INODE;
        spcl.c_count = 0;
        i = ip->di_mode & IFMT;
-       if ((i != IFDIR && i != IFREG) || ip->di_size == 0) {
+       if ((i != IFDIR && i != IFREG && i != IFLNK) || ip->di_size == 0) {
                spclrec();
                return;
        }
                spclrec();
                return;
        }
@@ -171,8 +170,8 @@ blksout(blkp, frags)
 {
        int i, j, count, blks, tbperdb;
 
 {
        int i, j, count, blks, tbperdb;
 
-       blks = frags * BLKING(sblock);
-       tbperdb = BLKING(sblock) * sblock->fs_frag;
+       blks = howmany(frags * sblock->fs_fsize, TP_BSIZE);
+       tbperdb = sblock->fs_bsize / TP_BSIZE;
        for (i = 0; i < blks; i += TP_NINDIR) {
                if (i + TP_NINDIR > blks)
                        count = blks;
        for (i = 0; i < blks; i += TP_NINDIR) {
                if (i + TP_NINDIR > blks)
                        count = blks;
@@ -222,7 +221,7 @@ spclrec()
        register int s, i, *ip;
 
        spcl.c_inumber = ino;
        register int s, i, *ip;
 
        spcl.c_inumber = ino;
-       spcl.c_magic = MAGIC;
+       spcl.c_magic = NFS_MAGIC;
        spcl.c_checksum = 0;
        ip = (int *)&spcl;
        s = 0;
        spcl.c_checksum = 0;
        ip = (int *)&spcl;
        s = 0;