1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: */
6:
7: #if !defined(lint) && defined(DOSCCS)
8: static char sccsid[] = "@(#)pass1b.c 5.1 (Berkeley) 6/5/85";
9: #endif not lint
10:
11: #include <sys/param.h>
12: #include <sys/inode.h>
13: #include <sys/fs.h>
14: #include "fsck.h"
15:
16: int pass1bcheck();
17:
18: pass1b()
19: {
20: register int c, i;
21: register DINODE *dp;
22: struct inodesc idesc;
23: ino_t inumber;
24:
25: bzero((char *)&idesc, sizeof(struct inodesc));
26: idesc.id_type = ADDR;
27: idesc.id_func = pass1bcheck;
28: for (inumber = ROOTINO; inumber < lastino; inumber++) {
29: if (inumber < ROOTINO)
30: continue;
31: dp = ginode(inumber);
32: if (dp == NULL)
33: continue;
34: idesc.id_number = inumber;
35: if (getstate(inumber) != USTATE &&
36: (ckinode(dp, &idesc) & STOP))
37: goto out1b;
38: }
39: out1b:
40: flush(&dfile, &inoblk);
41: }
42:
43: pass1bcheck(idesc)
44: register struct inodesc *idesc;
45: {
46: register daddr_t *dlp;
47: daddr_t blkno = idesc->id_blkno;
48:
49: if (outrange(blkno))
50: return (SKIP);
51: for (dlp = duplist; dlp < muldup; dlp++) {
52: if (*dlp == blkno) {
53: blkerr(idesc->id_number, "DUP", blkno);
54: *dlp = *--muldup;
55: *muldup = blkno;
56: return (muldup == duplist ? STOP : KEEPON);
57: }
58: }
59: return (KEEPON);
60: }
Defined functions
Defined variables
sccsid
defined in line
8;
never used