sbin/restore/restore.c
/*
 *	Remove invalid whiteouts from the old tree.
 *	Remove unneeded leaves from the old tree.
 *	Remove directories from the lookup chains.
 */
Remove invalid whiteouts from the old tree.
Remove unneeded leaves from the old tree.
Remove directories from the lookup chains.
Remove invalid whiteouts from the old tree . Remove unneeded leaves from the old tree . Remove directories from the lookup chains .
void
removeoldleaves()
{
	register struct entry *ep, *nextep;
	register ino_t i, mydirino;
	vprintf(stdout, "Mark entries to be removed.\n");
	if (ep = lookupino(WINO)) {
		vprintf(stdout, "Delete whiteouts\n");
		for ( ; ep != NULL; ep = nextep) {
			nextep = ep->e_links;
			mydirino = ep->e_parent->e_ino;
			if (TSTINO(mydirino, usedinomap) &&
			    !TSTINO(mydirino, dumpmap))
				continue;
			delwhiteout(ep);
			freeentry(ep);
		}
	}
	for (i = ROOTINO + 1; i < maxino; i++) {
		ep = lookupino(i);
		if (ep == NULL)
			continue;
		if (TSTINO(i, usedinomap))
			continue;
		for ( ; ep != NULL; ep = ep->e_links) {
			dprintf(stdout, "%s: REMOVE\n", myname(ep));
			if (ep->e_type == LEAF) {
				removeleaf(ep);
				freeentry(ep);
			} else {
				mktempname(ep);
				deleteino(ep->e_ino);
				ep->e_next = removelist;
				removelist = ep;
			}
		}
	}
}
void removeoldleaves ( ) { register struct entry * ep , * nextep ; register ino_t i , mydirino ; vprintf ( stdout , " \n " ) ; if ( ep = lookupino ( WINO ) ) { vprintf ( stdout , " \n " ) ; for ( ; ep != NULL ; ep = nextep ) { nextep = ep -> e_links ; mydirino = ep -> e_parent -> e_ino ; if ( TSTINO ( mydirino , usedinomap ) && ! TSTINO ( mydirino , dumpmap ) ) continue ; delwhiteout ( ep ) ; freeentry ( ep ) ; } } for ( i = ROOTINO + 1 ; i < maxino ; i ++ ) { ep = lookupino ( i ) ; if ( ep == NULL ) continue ; if ( TSTINO ( i , usedinomap ) ) continue ; for ( ; ep != NULL ; ep = ep -> e_links ) { dprintf ( stdout , " \n " , myname ( ep ) ) ; if ( ep -> e_type == LEAF ) { removeleaf ( ep ) ; freeentry ( ep ) ; } else { mktempname ( ep ) ; deleteino ( ep -> e_ino ) ; ep -> e_next = removelist ; removelist = ep ; } } } }
Remove invalid whiteouts from the old tree.
Remove invalid whiteouts from the old tree .
/*
			 * We remove all whiteouts that are in directories
			 * that have been removed or that have been dumped.
			 */