Lines Matching defs:sample
562 ddf_meta_create(struct g_raid_disk *disk, struct ddf_meta *sample)
575 if (sample->hdr == NULL)
576 sample = NULL;
585 meta->bigendian = sample ? sample->bigendian : mdi->mdio_bigendian;
592 if (sample) {
593 memcpy(meta->hdr, sample->hdr, sizeof(struct ddf_header));
594 if (ss != sample->sectorsize) {
596 howmany(GET32(sample, hdr->WorkSpace_Length) *
597 sample->sectorsize, ss));
599 howmany(GET16(sample,
601 sample->sectorsize, ss));
603 howmany(GET32(sample, hdr->cd_length) *
604 sample->sectorsize, ss));
606 howmany(GET32(sample, hdr->pdr_length) *
607 sample->sectorsize, ss));
609 howmany(GET32(sample, hdr->vdr_length) *
610 sample->sectorsize, ss));
612 howmany(GET32(sample, hdr->cr_length) *
613 sample->sectorsize, ss));
615 howmany(GET32(sample, hdr->pdd_length) *
616 sample->sectorsize, ss));
618 howmany(GET32(sample, hdr->bbmlog_length) *
619 sample->sectorsize, ss));
621 howmany(GET32(sample, hdr->bbmlog_length) *
622 sample->sectorsize, ss));
624 howmany(GET32(sample, hdr->bbmlog_length) *
625 sample->sectorsize, ss));
842 ddf_vol_meta_create(struct ddf_vol_meta *meta, struct ddf_meta *sample)
849 hdr = sample->hdr;
850 meta->bigendian = sample->bigendian;
851 ss = meta->sectorsize = sample->sectorsize;
853 memcpy(meta->hdr, sample->hdr, ss);
854 meta->cdr = malloc(GET32(sample, hdr->cd_length) * ss, M_MD_DDF, M_WAITOK);
855 memcpy(meta->cdr, sample->cdr, GET32(sample, hdr->cd_length) * ss);
863 size = GET16(sample, hdr->Configuration_Record_Length) * ss;