FreeBSD/sys/geom/vinum/geom_vinum_plex.c
/*
 * Create a new bio struct for the next grow request.
 */
Create a new bio struct for the next grow request.
Create a new bio struct for the next grow request .
int
gv_grow_request(struct gv_plex *p, off_t offset, off_t length, int type,
    caddr_t data)
{
	struct gv_softc *sc;
	struct bio *bp;
	KASSERT(p != NULL, ("gv_grow_request: NULL p"));
	sc = p->vinumconf;
	KASSERT(sc != NULL, ("gv_grow_request: NULL sc"));
	bp = g_new_bio();
	if (bp == NULL) {
		G_VINUM_DEBUG(0, "grow of %s failed creating bio: "
		    "out of memory", p->name);
		return (ENOMEM);
	}
	bp->bio_cmd = type;
	bp->bio_done = gv_done;
	bp->bio_error = 0;
	bp->bio_caller1 = p;
	bp->bio_offset = offset;
	bp->bio_length = length;
	bp->bio_pflags |= GV_BIO_GROW;
	if (data == NULL)
		data = g_malloc(length, M_WAITOK);
	bp->bio_pflags |= GV_BIO_MALLOC;
	bp->bio_data = data;
	gv_post_bio(sc, bp);
	return (0);
}
int gv_grow_request ( struct gv_plex * p , off_t offset , off_t length , int type , caddr_t data ) { 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 ( ENOMEM ) ; } bp -> bio_cmd = type ; bp -> bio_done = gv_done ; bp -> bio_error = 0 ; bp -> bio_caller1 = p ; bp -> bio_offset = offset ; bp -> bio_length = length ; bp -> bio_pflags |= GV_BIO_GROW ; if ( data == NULL ) data = g_malloc ( length , M_WAITOK ) ; bp -> bio_pflags |= GV_BIO_MALLOC ; bp -> bio_data = data ; gv_post_bio ( sc , bp ) ; return ( 0 ) ; }
Create a new bio struct for the next grow request.
Create a new bio struct for the next grow request .
//gv_plex_start(p, bp);