sbin/restore/restore.c
/*
 * Remove old nodes (directories).
 * Note that this routine runs in O(N*D) where:
 *	N is the number of directory entries to be removed.
 *	D is the maximum depth of the tree.
 * If N == D this can be quite slow. If the list were
 * topologically sorted, the deletion could be done in
 * time O(N).
 */
Remove old nodes (directories).
Note that this routine runs in O(N*D) where:
N is the number of directory entries to be removed.
D is the maximum depth of the tree.
If N == D this can be quite slow. If the list were
topologically sorted, the deletion could be done in
time O(N).
Remove old nodes ( directories ) . Note that this routine runs in O ( N * D ) where : N is the number of directory entries to be removed . D is the maximum depth of the tree . If N == D this can be quite slow . If the list were topologically sorted the deletion could be done in time O ( N ) .
void
removeoldnodes()
{
	register struct entry *ep, **prev;
	long change;
	vprintf(stdout, "Remove old nodes (directories).\n");
	do	{
		change = 0;
		prev = &removelist;
		for (ep = removelist; ep != NULL; ep = *prev) {
			if (ep->e_entries != NULL) {
				prev = &ep->e_next;
				continue;
			}
			*prev = ep->e_next;
			removenode(ep);
			freeentry(ep);
			change++;
		}
	} while (change);
	for (ep = removelist; ep != NULL; ep = ep->e_next)
		badentry(ep, "cannot remove, non-empty");
}
void removeoldnodes ( ) { register struct entry * ep , * * prev ; long change ; vprintf ( stdout , " \n " ) ; do { change = 0 ; prev = & removelist ; for ( ep = removelist ; ep != NULL ; ep = * prev ) { if ( ep -> e_entries != NULL ) { prev = & ep -> e_next ; continue ; } * prev = ep -> e_next ; removenode ( ep ) ; freeentry ( ep ) ; change ++ ; } } while ( change ) ; for ( ep = removelist ; ep != NULL ; ep = ep -> e_next ) badentry ( ep , " " ) ; }
Remove old nodes (directories).
Remove old nodes ( directories ) .