summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-10-14 21:27:36 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-10-14 21:27:36 +0000
commit246f8a9691797e2bc8a8d647dee0d00a9d955c76 (patch)
tree56d5b976161f8e238734f05da0fd62ddc8cacfb2
parent32240511feea3e5d7fcda255788128c8010af6d8 (diff)
Formerly pass5.c.~5~
-rw-r--r--ufs-fsck/pass5.c37
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 ()
{