sbin/fsck/dir.c
/*
 * Propagate connected state through the tree.
 */
Propagate connected state through the tree.
Propagate connected state through the tree .
void
propagate()
{
	register struct inoinfo **inpp, *inp;
	struct inoinfo **inpend;
	long change;
	inpend = &inpsort[inplast];
	do {
		change = 0;
		for (inpp = inpsort; inpp < inpend; inpp++) {
			inp = *inpp;
			if (inp->i_parent == 0)
				continue;
			if (statemap[inp->i_parent] == DFOUND &&
			    statemap[inp->i_number] == DSTATE) {
				statemap[inp->i_number] = DFOUND;
				change++;
			}
		}
	} while (change > 0);
}
void propagate ( ) { register struct inoinfo * * inpp , * inp ; struct inoinfo * * inpend ; long change ; inpend = & inpsort [ inplast ] ; do { change = 0 ; for ( inpp = inpsort ; inpp < inpend ; inpp ++ ) { inp = * inpp ; if ( inp -> i_parent == 0 ) continue ; if ( statemap [ inp -> i_parent ] == DFOUND && statemap [ inp -> i_number ] == DSTATE ) { statemap [ inp -> i_number ] = DFOUND ; change ++ ; } } } while ( change > 0 ) ; }
Propagate connected state through the tree.
Propagate connected state through the tree .