From f3cd6e6d3ce1ed28a668dd8317defc4935216f9b Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 14 Oct 1994 21:27:36 +0000 Subject: Formerly pass5.c.~5~ --- ufs-fsck/pass5.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'ufs-fsck') diff --git a/ufs-fsck/pass5.c b/ufs-fsck/pass5.c index 1311db28..c2c94a5b 100644 --- a/ufs-fsck/pass5.c +++ b/ufs-fsck/pass5.c @@ -20,6 +20,43 @@ #include "fsck.h" +/* From ../ufs/subr.c: */ + +/* + * Update the frsum fields to reflect addition or deletion + * of some frags. + */ +static void +ffs_fragacct(fs, fragmap, fraglist, cnt) + struct fs *fs; + int fragmap; + long fraglist[]; + int cnt; +{ + int inblk; + register int field, subfield; + register int siz, pos; + + inblk = (int)(fragtbl[fs->fs_frag][fragmap]) << 1; + fragmap <<= 1; + for (siz = 1; siz < fs->fs_frag; siz++) { + if ((inblk & (1 << (siz + (fs->fs_frag % NBBY)))) == 0) + continue; + field = around[siz]; + subfield = inside[siz]; + for (pos = siz; pos <= fs->fs_frag; pos++) { + if ((fragmap & field) == subfield) { + fraglist[siz] += cnt; + pos += siz; + field <<= siz; + subfield <<= siz; + } + field <<= 1; + subfield <<= 1; + } + } +} + void pass5 () { -- cgit v1.2.3