FreeBSD/sys/geom/vinum/geom_vinum_init.c
/* Sync a plex p from the plex up.  */
Sync a plex p from the plex up.
Sync a plex p from the plex up .
static int
gv_sync_plex(struct gv_plex *p, struct gv_plex *up)
{
	int error;
	KASSERT(p != NULL, ("%s: NULL p", __func__));
	KASSERT(up != NULL, ("%s: NULL up", __func__));
	if ((p == up) || (p->state == GV_PLEX_UP))
		return (0);
	if (p->flags & GV_PLEX_SYNCING ||
	    p->flags & GV_PLEX_REBUILDING ||
	    p->flags & GV_PLEX_GROWING) {
		return (EINPROGRESS);
	}
	p->synced = 0;
	p->flags |= GV_PLEX_SYNCING;
	G_VINUM_DEBUG(1, "starting sync of plex %s", p->name);
	error = gv_sync_request(up, p, p->synced, 
	    MIN(GV_DFLT_SYNCSIZE, up->size - p->synced), 
	    BIO_READ, NULL);
	if (error) {
		G_VINUM_DEBUG(0, "error syncing plex %s", p->name);
		return (error);
	}
	return (0);
}
static int gv_sync_plex ( struct gv_plex * p , struct gv_plex * up ) { int error ; KASSERT ( p != NULL , ( " " , __func__ ) ) ; KASSERT ( up != NULL , ( " " , __func__ ) ) ; if ( ( p == up ) || ( p -> state == GV_PLEX_UP ) ) return ( 0 ) ; if ( p -> flags & GV_PLEX_SYNCING || p -> flags & GV_PLEX_REBUILDING || p -> flags & GV_PLEX_GROWING ) { return ( EINPROGRESS ) ; } p -> synced = 0 ; p -> flags |= GV_PLEX_SYNCING ; G_VINUM_DEBUG ( 1 , " " , p -> name ) ; error = gv_sync_request ( up , p , p -> synced , MIN ( GV_DFLT_SYNCSIZE , up -> size - p -> synced ) , BIO_READ , NULL ) ; if ( error ) { G_VINUM_DEBUG ( 0 , " " , p -> name ) ; return ( error ) ; } return ( 0 ) ; }
Sync a plex p from the plex up.
Sync a plex p from the plex up .