void refresh_node( struct ip_node *node) { for( ; node ; node=node->next ) { node->hits[PREV_POS] = node->hits[CURR_POS]; node->hits[CURR_POS] = 0; node->leaf_hits[PREV_POS] = node->leaf_hits[CURR_POS]; node->leaf_hits[CURR_POS] = 0; if (node->kids) refresh_node( node->kids ); } }
static inline void refresh_node( struct ip_node *node) { for( ; node ; node=node->next ) { node->hits[PREV_POS] = node->hits[CURR_POS]; node->hits[CURR_POS] = 0; node->leaf_hits[PREV_POS] = node->leaf_hits[CURR_POS]; node->leaf_hits[CURR_POS] = 0; if ( node->flags&NODE_ISRED_FLAG && !is_node_hot_leaf(node) ) { node->flags &= ~(NODE_ISRED_FLAG); LM_GEN1( pike_log_level,"PIKE - UNBLOCKing node %p\n",node); } if (node->kids) refresh_node( node->kids ); } }
void swap_routine( unsigned int ticks, void *param) { struct ip_node *node; int i; /* LM_DBG("entering \n"); */ for(i=0;i<MAX_IP_BRANCHES;i++) { node = get_tree_branch(i); if (node) { lock_tree_branch( i ); node = get_tree_branch(i); /* again, to avoid races */ if (node) refresh_node( node ); unlock_tree_branch( i ); } } }