diff options
author | julian <julian@FreeBSD.org> | 1998-12-03 02:27:35 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1998-12-03 02:27:35 +0000 |
commit | c1ef9f83c919949e90841ae0990aa9a0273d6490 (patch) | |
tree | 766d55719160577172499b05ce54cc96670cf3c4 /sbin/fsck_ffs/pass5.c | |
parent | 1a5eceeafeb45fc95a5c9fe1830e0d3e349ec69a (diff) | |
download | FreeBSD-src-c1ef9f83c919949e90841ae0990aa9a0273d6490.zip FreeBSD-src-c1ef9f83c919949e90841ae0990aa9a0273d6490.tar.gz |
Reviewed by: Don Lewis <Don.Lewis@tsc.tdk.com>
Submitted by: Kirk McKusick <mckusick@McKusick.COM>
Obtained from: Mckusick, BSDI and a host of others
This exactly matches Kirks sources imported under the
Tag MCKUSICK2. These are as supplied by kirk with one small
change needed to compile under freeBSD.
Some FreeBSD patches will be added back, though many have been
added to Kirk's sources already.
Diffstat (limited to 'sbin/fsck_ffs/pass5.c')
-rw-r--r-- | sbin/fsck_ffs/pass5.c | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index f3994f8..d492a18 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -32,14 +32,11 @@ */ #ifndef lint -#if 0 static const char sccsid[] = "@(#)pass5.c 8.9 (Berkeley) 4/28/95"; -#endif -static const char rcsid[] = - "$Id: pass5.c,v 1.13 1998/08/04 09:19:03 phk Exp $"; #endif /* not lint */ #include <sys/param.h> +#include <sys/time.h> #include <ufs/ufs/dinode.h> #include <ufs/ffs/fs.h> @@ -52,7 +49,7 @@ static const char rcsid[] = void pass5() { - int c, blk, frags, basesize, sumsize, mapsize, savednrpos; + int c, blk, frags, basesize, sumsize, mapsize, savednrpos = 0; int inomapsize, blkmapsize; struct fs *fs = &sblock; struct cg *cg = &cgrp; @@ -66,7 +63,7 @@ pass5() register struct cg *newcg = (struct cg *)buf; struct ocg *ocg = (struct ocg *)buf; - statemap[WINO] = USTATE; + inoinfo(WINO)->ino_state = USTATE; memset(newcg, 0, (size_t)fs->fs_cgsize); newcg->cg_niblk = fs->fs_ipg; if (cvtlevel >= 3) { @@ -207,8 +204,8 @@ pass5() if (fs->fs_postblformat == FS_42POSTBLFMT) ocg->cg_magic = CG_MAGIC; j = fs->fs_ipg * c; - for (i = 0; i < fs->fs_ipg; j++, i++) { - switch (statemap[j]) { + for (i = 0; i < inostathead[c].il_numalloced; j++, i++) { + switch (inoinfo(j)->ino_state) { case USTATE: break; @@ -229,7 +226,7 @@ pass5() if (j < ROOTINO) break; errx(EEXIT, "BAD STATE %d FOR INODE I=%ld", - statemap[j], j); + inoinfo(j)->ino_state, j); } } if (c == 0) @@ -325,7 +322,7 @@ pass5() if (cg_inosused(cg)[i] & (1 << k)) continue; pwarn("ALLOCATED INODE %d MARKED FREE\n", - c * fs->fs_ipg + i * 8 + k); + c * fs->fs_ipg + i * NBBY + k); } } for (i = 0; i < blkmapsize; i++) { @@ -338,7 +335,7 @@ pass5() if (cg_blksfree(newcg)[i] & (1 << k)) continue; pwarn("ALLOCATED FRAG %d MARKED FREE\n", - c * fs->fs_fpg + i * 8 + k); + c * fs->fs_fpg + i * NBBY + k); } } } @@ -355,24 +352,7 @@ pass5() && dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) { memmove(&fs->fs_cstotal, &cstotal, sizeof *cs); fs->fs_ronly = 0; + fs->fs_fmod = 0; sbdirty(); } - if (fs->fs_fmod != 0) { - pwarn("MODIFIED FLAG SET IN SUPERBLOCK"); - if (preen) - printf(" (FIXED)\n"); - if (preen || reply("FIX") == 1) { - fs->fs_fmod = 0; - sbdirty(); - } - } - if (fs->fs_clean == 0) { - pwarn("CLEAN FLAG NOT SET IN SUPERBLOCK"); - if (preen) - printf(" (FIXED)\n"); - if (preen || reply("FIX") == 1) { - fs->fs_clean = 1; - sbdirty(); - } - } } |