usr/src/cmd/zpool/zpool_iter.c
/*
 * Iterate over all pools in the list, executing the callback for each
 */
Iterate over all pools in the list, executing the callback for each
Iterate over all pools in the list executing the callback for each
int
pool_list_iter(zpool_list_t *zlp, int unavail, zpool_iter_f func,
    void *data)
{
	zpool_node_t *node, *next_node;
	int ret = 0;
	for (node = uu_avl_first(zlp->zl_avl); node != NULL; node = next_node) {
		next_node = uu_avl_next(zlp->zl_avl, node);
		if (zpool_get_state(node->zn_handle) != POOL_STATE_UNAVAIL ||
		    unavail)
			ret |= func(node->zn_handle, data);
	}
	return (ret);
}
int pool_list_iter ( zpool_list_t * zlp , int unavail , zpool_iter_f func , void * data ) { zpool_node_t * node , * next_node ; int ret = 0 ; for ( node = uu_avl_first ( zlp -> zl_avl ) ; node != NULL ; node = next_node ) { next_node = uu_avl_next ( zlp -> zl_avl , node ) ; if ( zpool_get_state ( node -> zn_handle ) != POOL_STATE_UNAVAIL || unavail ) ret |= func ( node -> zn_handle , data ) ; } return ( ret ) ; }
Iterate over all pools in the list, executing the callback for each
Iterate over all pools in the list executing the callback for each