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[] = "@(#)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: 
  24:     bzero((char *)&idesc, sizeof(struct inodesc));
  25:     idesc.id_type = DATA;
  26:     for (inumber = ROOTINO; inumber <= lastino; inumber++) {
  27:         if (getstate(inumber) == DSTATE) {
  28:             pathp = pathname;
  29:             *pathp++ = '?';
  30:             *pathp = '\0';
  31:             idesc.id_func = findino;
  32:             idesc.id_name = "..";
  33:             idesc.id_parent = inumber;
  34:             do {
  35:                 orphan = idesc.id_parent;
  36:                 if (orphan < ROOTINO || orphan > imax)
  37:                     break;
  38:                 dp = ginode(orphan);
  39:                 idesc.id_parent = 0;
  40:                 idesc.id_number = orphan;
  41:                 (void)ckinode(dp, &idesc);
  42:                 if (idesc.id_parent == 0)
  43:                     break;
  44:             } while (getstate(idesc.id_parent) == DSTATE);
  45:             if (linkup(orphan, idesc.id_parent) == 1) {
  46:                 idesc.id_func = pass2check;
  47:                 idesc.id_number = lfdir;
  48:                 descend(&idesc, orphan);
  49:             }
  50:         }
  51:     }
  52: }

Defined functions

pass3 defined in line 18; used 1 times

Defined variables

sccsid defined in line 8; never used
Last modified: 1990-04-23
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2094
Valid CSS Valid XHTML 1.0 Strict