FreeBSD/sys/geom/vinum/geom_vinum_plex.c
/*
 * Handle a finished parity write.
 */
Handle a finished parity write.
Handle a finished parity write .
void
gv_parity_complete(struct gv_plex *p, struct bio *bp)
{
	struct gv_softc *sc;
	int error, flags;
	error = bp->bio_error;
	flags = bp->bio_pflags;
	flags &= ~GV_BIO_MALLOC;
	sc = p->vinumconf;
	KASSERT(sc != NULL, ("gv_parity_complete: NULL sc"));
	if (bp->bio_pflags & GV_BIO_MALLOC)
		g_free(bp->bio_data);
	g_destroy_bio(bp);
	if (error == EAGAIN) {
		G_VINUM_DEBUG(0, "parity incorrect at offset 0x%jx",
		    (intmax_t)p->synced);
	}
	if (error && !(error == EAGAIN && (flags & GV_BIO_PARITY))) {
		g_topology_assert_not();
		g_topology_lock();
		gv_access(p->vol_sc->provider, -1, -1, 0);
		g_topology_unlock();
		G_VINUM_DEBUG(0, "parity check on %s failed at 0x%jx "
		    "errno %d", p->name, (intmax_t)p->synced, error);
		return;
	} else {
		p->synced += p->stripesize;
	}
	if (p->synced >= p->size) {
		g_topology_assert_not();
		g_topology_lock();
		gv_access(p->vol_sc->provider, -1, -1, 0);
		g_topology_unlock();
		G_VINUM_DEBUG(1, "parity operation on %s finished", p->name);
		p->synced = 0;
		gv_post_event(sc, GV_EVENT_SAVE_CONFIG, sc, NULL, 0, 0);
		return;
	}
	gv_parity_request(p, flags, p->synced);
}
void gv_parity_complete ( struct gv_plex * p , struct bio * bp ) { struct gv_softc * sc ; int error , flags ; error = bp -> bio_error ; flags = bp -> bio_pflags ; flags &= ~ GV_BIO_MALLOC ; sc = p -> vinumconf ; KASSERT ( sc != NULL , ( " " ) ) ; if ( bp -> bio_pflags & GV_BIO_MALLOC ) g_free ( bp -> bio_data ) ; g_destroy_bio ( bp ) ; if ( error == EAGAIN ) { G_VINUM_DEBUG ( 0 , " " , ( intmax_t ) p -> synced ) ; } if ( error && ! ( error == EAGAIN && ( flags & GV_BIO_PARITY ) ) ) { g_topology_assert_not ( ) ; g_topology_lock ( ) ; gv_access ( p -> vol_sc -> provider , -1 , -1 , 0 ) ; g_topology_unlock ( ) ; G_VINUM_DEBUG ( 0 , " " " " , p -> name , ( intmax_t ) p -> synced , error ) ; return ; } else { p -> synced += p -> stripesize ; } if ( p -> synced >= p -> size ) { g_topology_assert_not ( ) ; g_topology_lock ( ) ; gv_access ( p -> vol_sc -> provider , -1 , -1 , 0 ) ; g_topology_unlock ( ) ; G_VINUM_DEBUG ( 1 , " " , p -> name ) ; p -> synced = 0 ; gv_post_event ( sc , GV_EVENT_SAVE_CONFIG , sc , NULL , 0 , 0 ) ; return ; } gv_parity_request ( p , flags , p -> synced ) ; }
Handle a finished parity write.
Handle a finished parity write .
/* Clean up what we allocated. */ /* Any error is fatal, except EAGAIN when we're rebuilding. */ /* Make sure we don't have the lock. */ /* Make sure we don't have the lock. */ /* We're finished. */ /* Send down next. It will determine if we need to itself. */