lib/libdmsg/msg_lnk.c
int
dmsg_debug_findspan(uint64_t msgid, dmsg_state_t **statep)
{
	h2span_cluster_t *cls;
	h2span_node_t *node;
	h2span_link_t *slink;

	pthread_mutex_lock(&cluster_mtx);
	RB_FOREACH(cls, h2span_cluster_tree, &cluster_tree) {
		RB_FOREACH(node, h2span_node_tree, &cls->tree) {
			RB_FOREACH(slink, h2span_link_tree, &node->tree) {
				if (slink->state->msgid == msgid) {
					*statep = slink->state;
					goto found;
				}
			}
		}
	}
	pthread_mutex_unlock(&cluster_mtx);
	*statep = NULL;
	return(ENOENT);
found:
	pthread_mutex_unlock(&cluster_mtx);
	return(0);
}
/*
 * DEBUG ONLY
 *
 * Locate the state representing an incoming LNK_SPAN given its msgid.
 */
DEBUG ONLY
Locate the state representing an incoming LNK_SPAN given its msgid.
DEBUG ONLY Locate the state representing an incoming LNK_SPAN given its msgid .
int
dmsg_debug_findspan(uint64_t msgid, dmsg_state_t **statep)
{
	h2span_cluster_t *cls;
	h2span_node_t *node;
	h2span_link_t *slink;
	pthread_mutex_lock(&cluster_mtx);
	RB_FOREACH(cls, h2span_cluster_tree, &cluster_tree) {
		RB_FOREACH(node, h2span_node_tree, &cls->tree) {
			RB_FOREACH(slink, h2span_link_tree, &node->tree) {
				if (slink->state->msgid == msgid) {
					*statep = slink->state;
					goto found;
				}
			}
		}
	}
	pthread_mutex_unlock(&cluster_mtx);
	*statep = NULL;
	return(ENOENT);
found:
	pthread_mutex_unlock(&cluster_mtx);
	return(0);
}
int dmsg_debug_findspan ( uint64_t msgid , dmsg_state_t * * statep ) { h2span_cluster_t * cls ; h2span_node_t * node ; h2span_link_t * slink ; pthread_mutex_lock ( & cluster_mtx ) ; RB_FOREACH ( cls , h2span_cluster_tree , & cluster_tree ) { RB_FOREACH ( node , h2span_node_tree , & cls -> tree ) { RB_FOREACH ( slink , h2span_link_tree , & node -> tree ) { if ( slink -> state -> msgid == msgid ) { * statep = slink -> state ; goto found ; } } } } pthread_mutex_unlock ( & cluster_mtx ) ; * statep = NULL ; return ( ENOENT ) ; found : pthread_mutex_unlock ( & cluster_mtx ) ; return ( 0 ) ; }
DEBUG ONLY
 Locate the state representing an incoming LNK_SPAN given its msgid.
DEBUG ONLY Locate the state representing an incoming LNK_SPAN given its msgid .