FreeBSD/sys/geom/virstor/g_virstor.c
/*
 * Fills metadata (struct md) from information stored in softc and the nc'th
 * component of virstor
 */
Fills metadata (struct md) from information stored in softc and the nc'th
component of virstor
Fills metadata ( struct md ) from information stored in softc and the nc ' th component of virstor
static void
fill_metadata(struct g_virstor_softc *sc, struct g_virstor_metadata *md,
    u_int nc, u_int hardcode)
{
	struct g_virstor_component *c;
	bzero(md, sizeof *md);
	c = &sc->components[nc];
	strncpy(md->md_magic, G_VIRSTOR_MAGIC, sizeof md->md_magic);
	md->md_version = G_VIRSTOR_VERSION;
	strncpy(md->md_name, sc->geom->name, sizeof md->md_name);
	md->md_id = sc->id;
	md->md_virsize = sc->virsize;
	md->md_chunk_size = sc->chunk_size;
	md->md_count = sc->n_components;
	if (hardcode) {
		strncpy(md->provider, c->gcons->provider->name,
		    sizeof md->provider);
	}
	md->no = nc;
	md->provsize = c->gcons->provider->mediasize;
	md->chunk_count = c->chunk_count;
	md->chunk_next = c->chunk_next;
	md->chunk_reserved = c->chunk_reserved;
	md->flags = c->flags;
}
static void fill_metadata ( struct g_virstor_softc * sc , struct g_virstor_metadata * md , u_int nc , u_int hardcode ) { struct g_virstor_component * c ; bzero ( md , sizeof * md ) ; c = & sc -> components [ nc ] ; strncpy ( md -> md_magic , G_VIRSTOR_MAGIC , sizeof md -> md_magic ) ; md -> md_version = G_VIRSTOR_VERSION ; strncpy ( md -> md_name , sc -> geom -> name , sizeof md -> md_name ) ; md -> md_id = sc -> id ; md -> md_virsize = sc -> virsize ; md -> md_chunk_size = sc -> chunk_size ; md -> md_count = sc -> n_components ; if ( hardcode ) { strncpy ( md -> provider , c -> gcons -> provider -> name , sizeof md -> provider ) ; } md -> no = nc ; md -> provsize = c -> gcons -> provider -> mediasize ; md -> chunk_count = c -> chunk_count ; md -> chunk_next = c -> chunk_next ; md -> chunk_reserved = c -> chunk_reserved ; md -> flags = c -> flags ; }
Fills metadata (struct md) from information stored in softc and the nc'th
 component of virstor
Fills metadata ( struct md ) from information stored in softc and the nc ' th component of virstor