FreeBSD/sys/geom/mirror/g_mirror.c
/*
 * Return TRUE if the given sync request is colliding with a in-progress regular
 * request.
 */
Return TRUE if the given sync request is colliding with a in-progress regular
request.
Return TRUE if the given sync request is colliding with a in - progress regular request .
static int
g_mirror_regular_collision(struct g_mirror_softc *sc, struct bio *sbp)
{
	off_t rstart, rend, sstart, send;
	struct bio *bp;
	if (sc->sc_sync.ds_ndisks == 0)
		return (0);
	sstart = sbp->bio_offset;
	send = sbp->bio_offset + sbp->bio_length;
	TAILQ_FOREACH(bp, &sc->sc_inflight.queue, bio_queue) {
		rstart = bp->bio_offset;
		rend = bp->bio_offset + bp->bio_length;
		if (rend > sstart && rstart < send)
			return (1);
	}
	return (0);
}
static int g_mirror_regular_collision ( struct g_mirror_softc * sc , struct bio * sbp ) { off_t rstart , rend , sstart , send ; struct bio * bp ; if ( sc -> sc_sync . ds_ndisks == 0 ) return ( 0 ) ; sstart = sbp -> bio_offset ; send = sbp -> bio_offset + sbp -> bio_length ; TAILQ_FOREACH ( bp , & sc -> sc_inflight . queue , bio_queue ) { rstart = bp -> bio_offset ; rend = bp -> bio_offset + bp -> bio_length ; if ( rend > sstart && rstart < send ) return ( 1 ) ; } return ( 0 ) ; }
Return TRUE if the given sync request is colliding with a in-progress regular
 request.
Return TRUE if the given sync request is colliding with a in - progress regular request .