FreeBSD/sys/geom/vinum/geom_vinum_plex.c
/*
 * Create a new bio struct for the next parity rebuild. Used both by internal
 * rebuild of degraded plexes as well as user initiated rebuilds/checks.
 */
Create a new bio struct for the next parity rebuild. Used both by internal
rebuild of degraded plexes as well as user initiated rebuilds/checks.
Create a new bio struct for the next parity rebuild . Used both by internal rebuild of degraded plexes as well as user initiated rebuilds / checks .
void
gv_parity_request(struct gv_plex *p, int flags, off_t offset)
{
	struct gv_softc *sc;
	struct bio *bp;
	KASSERT(p != NULL, ("gv_parity_request: NULL p"));
	sc = p->vinumconf;
	KASSERT(sc != NULL, ("gv_parity_request: NULL sc"));
	bp = g_new_bio();
	if (bp == NULL) {
		G_VINUM_DEBUG(0, "rebuild of %s failed creating bio: "
		    "out of memory", p->name);
		return;
	}
	bp->bio_cmd = BIO_WRITE;
	bp->bio_done = gv_done;
	bp->bio_error = 0;
	bp->bio_length = p->stripesize;
	bp->bio_caller1 = p;
	if (flags & GV_BIO_REBUILD)
		bp->bio_data = g_malloc(GV_DFLT_SYNCSIZE, M_WAITOK);
	else if (flags & GV_BIO_CHECK)
		bp->bio_data = g_malloc(p->stripesize, M_WAITOK | M_ZERO);
	else {
		G_VINUM_DEBUG(0, "invalid flags given in rebuild");
		return;
	}
	bp->bio_pflags = flags;
	bp->bio_pflags |= GV_BIO_MALLOC;
	bp->bio_offset = offset;
	gv_post_bio(sc, bp);
}
void gv_parity_request ( struct gv_plex * p , int flags , off_t offset ) { struct gv_softc * sc ; struct bio * bp ; KASSERT ( p != NULL , ( " " ) ) ; sc = p -> vinumconf ; KASSERT ( sc != NULL , ( " " ) ) ; bp = g_new_bio ( ) ; if ( bp == NULL ) { G_VINUM_DEBUG ( 0 , " " " " , p -> name ) ; return ; } bp -> bio_cmd = BIO_WRITE ; bp -> bio_done = gv_done ; bp -> bio_error = 0 ; bp -> bio_length = p -> stripesize ; bp -> bio_caller1 = p ; if ( flags & GV_BIO_REBUILD ) bp -> bio_data = g_malloc ( GV_DFLT_SYNCSIZE , M_WAITOK ) ; else if ( flags & GV_BIO_CHECK ) bp -> bio_data = g_malloc ( p -> stripesize , M_WAITOK | M_ZERO ) ; else { G_VINUM_DEBUG ( 0 , " " ) ; return ; } bp -> bio_pflags = flags ; bp -> bio_pflags |= GV_BIO_MALLOC ; bp -> bio_offset = offset ; gv_post_bio ( sc , bp ) ; }
Create a new bio struct for the next parity rebuild.
Create a new bio struct for the next parity rebuild .
/*
	 * Check if it's a rebuild of a degraded plex or a user request of
	 * parity rebuild.
	 */ /* We still have more parity to build. */ //gv_plex_start(p, bp); /* Send it down to the plex. */