lib/dns/rbtdb.c
/*%
 * Clean up dead nodes.  These are nodes which have no references, and
 * have no data.  They are dead but we could not or chose not to delete
 * them when we deleted all the data at that node because we did not want
 * to wait for the tree write lock.
 *
 * The caller must hold a tree write lock and bucketnum'th node (write) lock.
 */
%
Clean up dead nodes.  These are nodes which have no references, and
have no data.  They are dead but we could not or chose not to delete
them when we deleted all the data at that node because we did not want
to wait for the tree write lock.

The caller must hold a tree write lock and bucketnum'th node (write) lock.
% Clean up dead nodes . These are nodes which have no references and have no data . They are dead but we could not or chose not to delete them when we deleted all the data at that node because we did not want to wait for the tree write lock . The caller must hold a tree write lock and bucketnum ' th node ( write ) lock .
static void
cleanup_dead_nodes(dns_rbtdb_t *rbtdb, int bucketnum) {
	dns_rbtnode_t *node;
	int count = 10;         
	node = ISC_LIST_HEAD(rbtdb->deadnodes[bucketnum]);
	while (node != NULL && count > 0) {
		ISC_LIST_UNLINK(rbtdb->deadnodes[bucketnum], node, deadlink);
		INSIST(dns_rbtnode_refcurrent(node) == 0 &&
		       node->data == NULL);
		delete_node(rbtdb, node);
		node = ISC_LIST_HEAD(rbtdb->deadnodes[bucketnum]);
		count--;
	}
}
static void cleanup_dead_nodes ( dns_rbtdb_t * rbtdb , int bucketnum ) { dns_rbtnode_t * node ; int count = 10 ; node = ISC_LIST_HEAD ( rbtdb -> deadnodes [ bucketnum ] ) ; while ( node != NULL && count > 0 ) { ISC_LIST_UNLINK ( rbtdb -> deadnodes [ bucketnum ] , node , deadlink ) ; INSIST ( dns_rbtnode_refcurrent ( node ) == 0 && node -> data == NULL ) ; delete_node ( rbtdb , node ) ; node = ISC_LIST_HEAD ( rbtdb -> deadnodes [ bucketnum ] ) ; count -- ; } }
%
 Clean up dead nodes.
% Clean up dead nodes .
/* XXXJT: should be adjustable */ /*
		 * Since we're holding a tree write lock, it should be
		 * impossible for this node to be referenced by others.
		 */