FreeBSD/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
/*
 * Check the other, lower-index DVAs to see if they're on the same
 * vdev as the child we picked.  If they are, use them since they
 * are likely to have been allocated from the primary metaslab in
 * use at the time, and hence are more likely to have locality with
 * single-copy data.
 */
Check the other, lower-index DVAs to see if they're on the same
vdev as the child we picked.  If they are, use them since they
are likely to have been allocated from the primary metaslab in
use at the time, and hence are more likely to have locality with
single-copy data.
Check the other lower - index DVAs to see if they ' re on the same vdev as the child we picked . If they are use them since they are likely to have been allocated from the primary metaslab in use at the time and hence are more likely to have locality with single - copy data .
static int
vdev_mirror_dva_select(zio_t *zio, int p)
{
	dva_t *dva = zio->io_bp->blk_dva;
	mirror_map_t *mm = zio->io_vsd;
	int preferred;
	int c;
	preferred = mm->mm_preferred[p];
	for (p-- ; p >= 0; p--) {
		c = mm->mm_preferred[p];
		if (DVA_GET_VDEV(&dva[c]) == DVA_GET_VDEV(&dva[preferred]))
			preferred = c;
	}
	return (preferred);
}
static int vdev_mirror_dva_select ( zio_t * zio , int p ) { dva_t * dva = zio -> io_bp -> blk_dva ; mirror_map_t * mm = zio -> io_vsd ; int preferred ; int c ; preferred = mm -> mm_preferred [ p ] ; for ( p -- ; p >= 0 ; p -- ) { c = mm -> mm_preferred [ p ] ; if ( DVA_GET_VDEV ( & dva [ c ] ) == DVA_GET_VDEV ( & dva [ preferred ] ) ) preferred = c ; } return ( preferred ) ; }
Check the other, lower-index DVAs to see if they're on the same
 vdev as the child we picked.
Check the other lower - index DVAs to see if they ' re on the same vdev as the child we picked .