src/fs/zfs/metaslab.c
/*
 * Comparison function for the private size-ordered tree. Tree is sorted
 * by size, larger sizes at the end of the tree.
 */
Comparison function for the private size-ordered tree. Tree is sorted
by size, larger sizes at the end of the tree.
Comparison function for the private size - ordered tree . Tree is sorted by size larger sizes at the end of the tree .
static int
metaslab_rangesize_compare(const void *x1, const void *x2)
{
	const range_seg_t *r1 = x1;
	const range_seg_t *r2 = x2;
	uint64_t rs_size1 = r1->rs_end - r1->rs_start;
	uint64_t rs_size2 = r2->rs_end - r2->rs_start;
	if (rs_size1 < rs_size2)
		return (-1);
	if (rs_size1 > rs_size2)
		return (1);
	if (r1->rs_start < r2->rs_start)
		return (-1);
	if (r1->rs_start > r2->rs_start)
		return (1);
	return (0);
}
static int metaslab_rangesize_compare ( const void * x1 , const void * x2 ) { const range_seg_t * r1 = x1 ; const range_seg_t * r2 = x2 ; uint64_t rs_size1 = r1 -> rs_end - r1 -> rs_start ; uint64_t rs_size2 = r2 -> rs_end - r2 -> rs_start ; if ( rs_size1 < rs_size2 ) return ( -1 ) ; if ( rs_size1 > rs_size2 ) return ( 1 ) ; if ( r1 -> rs_start < r2 -> rs_start ) return ( -1 ) ; if ( r1 -> rs_start > r2 -> rs_start ) return ( 1 ) ; return ( 0 ) ; }
Comparison function for the private size-ordered tree.
Comparison function for the private size - ordered tree .