Annotation of 43BSDTahoe/etc/fsck/pass3.c, revision 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.2 (Berkeley) 1/7/87";
        !             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:                                if ((ckinode(dp, &idesc) & FOUND) == 0)
        !            44:                                        break;
        !            45:                                if (loopcnt >= sblock.fs_cstotal.cs_ndir)
        !            46:                                        break;
        !            47:                                loopcnt++;
        !            48:                        } while (statemap[idesc.id_parent] == DSTATE);
        !            49:                        if (linkup(orphan, idesc.id_parent) == 1) {
        !            50:                                idesc.id_func = pass2check;
        !            51:                                idesc.id_number = lfdir;
        !            52:                                descend(&idesc, orphan);
        !            53:                        }
        !            54:                }
        !            55:        }
        !            56: }

unix.superglobalmegacorp.com

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