summaryrefslogtreecommitdiff
path: root/ufs-fsck/pass1b.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-10-14 02:33:51 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-10-14 02:33:51 +0000
commitdb767a733ad6370063652b47e2169e4453350fc4 (patch)
treee77d56fc339492a5c1b4c7e5584eb75ea142cc27 /ufs-fsck/pass1b.c
parent6953d146a5c31044b36a55d42921394f758fb704 (diff)
Formerly pass1b.c.~3~
Diffstat (limited to 'ufs-fsck/pass1b.c')
-rw-r--r--ufs-fsck/pass1b.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/ufs-fsck/pass1b.c b/ufs-fsck/pass1b.c
index 0eaf6198..ac6c299f 100644
--- a/ufs-fsck/pass1b.c
+++ b/ufs-fsck/pass1b.c
@@ -18,6 +18,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include "fsck.h"
+
+void
pass1b ()
{
struct dinode dino;
@@ -37,20 +40,20 @@ pass1b ()
struct dups *dlp;
int hadbad = 0;
- for (nfrags; nfrags > 0; bno++, nfrags--)
+ for (; nfrags > 0; bno++, nfrags--)
{
- if (chkrange (blkno, 1))
+ if (check_range (bno, 1))
return RET_BAD;
for (dlp = duphead; dlp; dlp = dlp->next)
{
- if (dlp->dup == blkno)
+ if (dlp->dup == bno)
{
if (!dupblk)
- printf ("I=%lu HAD DUPLICATE BLOCKS\n", number);
+ printf ("I=%d HAD DUPLICATE BLOCKS\n", number);
dupblk++;
- printf ("DUPLICATE BLOCK %d\n", bno);
+ printf ("DUPLICATE BLOCK %ld\n", bno);
dlp->dup = duphead->dup;
- duphead->dup = blkno;
+ duphead->dup = bno;
duphead = duphead->next;
hadbad = 1;
}
@@ -63,26 +66,29 @@ pass1b ()
/* Call CHECKBLOCK for each block of each node, to see if it holds
a block already found to be a duplicate. */
- for (cg = 0; cg < sblock.fs_ncg; cg++)
- for (i = 0; i < sblock.fs_ipg; i++, number++)
+ for (cg = 0; cg < sblock->fs_ncg; cg++)
+ for (i = 0; i < sblock->fs_ipg; i++, number++)
{
if (number < ROOTINO)
continue;
- if (statemap[inumber] != UNALLOC)
+ if (inodestate[number] != UNALLOC)
{
getinode (number, dp);
dupblk = 0;
allblock_iterate (dp, checkblock);
if (dupblk)
{
- printf ("I=%ld has %d DUPLICATE BLOCKS\n", number, dupblk);
+ printf ("I=%d has %d DUPLICATE BLOCKS\n", number, dupblk);
if (reply ("CLEAR"))
{
clear_inode (number, dp);
- inode_state[number] = UNALLOC;
+ inodestate[number] = UNALLOC;
}
- else if (inodestate[number] == DIR)
+ else if (inodestate[number] == DIRECTORY)
inodestate[number] = BADDIR;
+ }
}
}
}
+
+