Annotation of 43BSD/etc/fsck/pass3.c, revision 1.1.1.1

1.1       root        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: #ifndef lint
                      8: static char sccsid[] = "@(#)pass3.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    pass2check();
                     17: 
                     18: pass3()
                     19: {
                     20:        register DINODE *dp;
                     21:        struct inodesc idesc;
                     22:        ino_t inumber, orphan;
                     23:        int loopcnt;
                     24: 
                     25:        bzero((char *)&idesc, sizeof(struct inodesc));
                     26:        idesc.id_type = DATA;
                     27:        for (inumber = ROOTINO; inumber <= lastino; inumber++) {
                     28:                if (statemap[inumber] == DSTATE) {
                     29:                        pathp = pathname;
                     30:                        *pathp++ = '?';
                     31:                        *pathp = '\0';
                     32:                        idesc.id_func = findino;
                     33:                        idesc.id_name = "..";
                     34:                        idesc.id_parent = inumber;
                     35:                        loopcnt = 0;
                     36:                        do {
                     37:                                orphan = idesc.id_parent;
                     38:                                if (orphan < ROOTINO || orphan > imax)
                     39:                                        break;
                     40:                                dp = ginode(orphan);
                     41:                                idesc.id_parent = 0;
                     42:                                idesc.id_number = orphan;
                     43:                                (void)ckinode(dp, &idesc);
                     44:                                if (idesc.id_parent == 0)
                     45:                                        break;
                     46:                                if (loopcnt >= sblock.fs_cstotal.cs_ndir)
                     47:                                        break;
                     48:                                loopcnt++;
                     49:                        } while (statemap[idesc.id_parent] == DSTATE);
                     50:                        if (linkup(orphan, idesc.id_parent) == 1) {
                     51:                                idesc.id_func = pass2check;
                     52:                                idesc.id_number = lfdir;
                     53:                                descend(&idesc, orphan);
                     54:                        }
                     55:                }
                     56:        }
                     57: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.