projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
missing fsbtodb!
[unix-history]
/
usr
/
src
/
sbin
/
fsck
/
utilities.c
diff --git
a/usr/src/sbin/fsck/utilities.c
b/usr/src/sbin/fsck/utilities.c
index
b888a54
..
3052033
100644
(file)
--- a/
usr/src/sbin/fsck/utilities.c
+++ b/
usr/src/sbin/fsck/utilities.c
@@
-5,7
+5,7
@@
*/
#ifndef lint
*/
#ifndef lint
-static char sccsid[] = "@(#)utilities.c 5.1
1
(Berkeley) %G%";
+static char sccsid[] = "@(#)utilities.c 5.1
3
(Berkeley) %G%";
#endif not lint
#include <stdio.h>
#endif not lint
#include <stdio.h>
@@
-117,6
+117,7
@@
bufinit()
bufhead.b_next = bp;
initbarea(bp);
}
bufhead.b_next = bp;
initbarea(bp);
}
+ bufhead.b_size = i; /* save number of buffers */
}
/*
}
/*
@@
-211,6
+212,7
@@
rwerr(s, blk)
ckfini()
{
register BUFAREA *bp;
ckfini()
{
register BUFAREA *bp;
+ int cnt = 0;
flush(&dfile, &sblk);
if (havesb && sblk.b_bno != SBOFF / dev_bsize &&
flush(&dfile, &sblk);
if (havesb && sblk.b_bno != SBOFF / dev_bsize &&
@@
-220,11
+222,15
@@
ckfini()
flush(&dfile, &sblk);
}
flush(&dfile, &cgblk);
flush(&dfile, &sblk);
}
flush(&dfile, &cgblk);
- for (bp = bufhead.b_prev; bp != &bufhead; bp = bp->b_prev)
+ for (bp = bufhead.b_prev; bp != &bufhead; bp = bp->b_prev) {
+ cnt++;
flush(&dfile, bp);
flush(&dfile, bp);
+ }
+ if (bufhead.b_size != cnt)
+ errexit("Panic: lost %d buffers\n", bufhead.b_size - cnt);
if (debug)
if (debug)
- printf("cache
hit %d of %d (%d%%)\n", totalreads -
diskreads,
- totalreads,
(totalreads - diskreads)
* 100 / totalreads);
+ printf("cache
missed %d of %d (%d%%)\n",
diskreads,
+ totalreads,
diskreads
* 100 / totalreads);
(void)close(dfile.rfdes);
(void)close(dfile.wfdes);
}
(void)close(dfile.rfdes);
(void)close(dfile.wfdes);
}