diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-10-14 21:27:36 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-10-14 21:27:36 +0000 |
commit | f3cd6e6d3ce1ed28a668dd8317defc4935216f9b (patch) | |
tree | b7f95a58485160a6321e9080ee4829eb64110aac /ufs-fsck | |
parent | 59a6501b5fefd27ec32efd355060dbc8c745bf9a (diff) |
Formerly pass5.c.~5~
Diffstat (limited to 'ufs-fsck')
-rw-r--r-- | ufs-fsck/pass5.c | 37 |
1 files changed, 37 insertions, 0 deletions
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 () { |