Lines Matching defs:vdc

75 	struct ddf_vdc_record *vdc;
222 struct ddf_vdc_record *vdc;
317 vdc = GETVDCPTR(meta, j);
318 val = GET32D(meta, vdc->Signature);
323 print_guid(vdc->VD_GUID);
326 GET32D(meta, vdc->Timestamp));
328 GET32D(meta, vdc->Sequence_Number));
330 GET16D(meta, vdc->Primary_Element_Count));
332 GET8D(meta, vdc->Stripe_Size));
334 GET8D(meta, vdc->Primary_RAID_Level));
336 GET8D(meta, vdc->RLQ));
338 GET8D(meta, vdc->Secondary_Element_Count));
340 GET8D(meta, vdc->Secondary_Element_Seq));
342 GET8D(meta, vdc->Secondary_RAID_Level));
344 GET64D(meta, vdc->Block_Count));
346 GET64D(meta, vdc->VD_Size));
348 GET16D(meta, vdc->Block_Size));
350 GET8D(meta, vdc->Rotate_Parity_count));
353 if (GET32D(meta, vdc->Associated_Spares[i]) != 0xffffffff)
354 printf(" 0x%08x", GET32D(meta, vdc->Associated_Spares[i]));
358 GET64D(meta, vdc->Cache_Flags));
360 GET8D(meta, vdc->BG_Rate));
362 GET8D(meta, vdc->MDF_Parity_Disks));
364 GET16D(meta, vdc->MDF_Parity_Generator_Polynomial));
366 GET8D(meta, vdc->MDF_Constant_Generation_Method));
368 num2 = GET16D(meta, vdc->Primary_Element_Count);
369 val2 = (uint64_t *)&(vdc->Physical_Disk_Sequence[GET16(meta, hdr->Max_Primary_Element_Entries)]);
372 GET32D(meta, vdc->Physical_Disk_Sequence[i]),
378 vuc = (struct ddf_vuc_record *)vdc;
385 sa = (struct ddf_sa_record *)vdc;
475 struct ddf_vdc_record *vdc;
480 vdc = GETVDCPTR(meta, i);
482 if (GET32D(meta, vdc->Signature) == DDF_VDCR_SIGNATURE &&
483 memcmp(vdc->VD_GUID, GUID, 24) == 0)
484 return (vdc);
486 if (GET32D(meta, vdc->Signature) == 0xffffffff ||
487 GET32D(meta, vdc->Signature) == 0)
488 return (vdc);
496 struct ddf_vdc_record *vdc;
502 vdc = GETVDCPTR(meta, i);
503 if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE)
505 if (GUID == NULL || memcmp(vdc->VD_GUID, GUID, 24) == 0)
518 for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) {
520 i += GET16(vmeta, vdc->Primary_Element_Count); // XXX
864 meta->vdc = malloc(size, M_MD_DDF, M_WAITOK);
865 memset(meta->vdc, 0xff, size);
866 SET32(meta, vdc->Signature, DDF_VDCR_SIGNATURE);
867 memcpy(meta->vdc->VD_GUID, meta->vde->VD_GUID, 24);
868 SET32(meta, vdc->Sequence_Number, 0);
877 struct ddf_vdc_record *vdc;
883 vdc = ddf_meta_find_vdc(src, GUID);
884 if (GET8D(src, vdc->Secondary_Element_Count) == 1)
887 bvd = GET8D(src, vdc->Secondary_Element_Seq);
890 if (dst->vdc == NULL ||
891 (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) -
892 GET32(dst, vdc->Sequence_Number))) > 0))
898 (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) -
919 if (dst->vdc != NULL)
920 free(dst->vdc, M_MD_DDF);
921 dst->vdc = malloc(size, M_MD_DDF, M_WAITOK);
922 memcpy(dst->vdc, vdc, size);
928 memcpy(dst->bvdc[bvd], vdc, size);
949 if (meta->vdc != NULL) {
950 free(meta->vdc, M_MD_DDF);
951 meta->vdc = NULL;
964 struct ddf_vdc_record *vdc;
979 vdc = GETVDCPTR(meta, i);
980 if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE)
982 for (pos = 0; pos < GET16D(meta, vdc->Primary_Element_Count); pos++)
983 if (GET32D(meta, vdc->Physical_Disk_Sequence[pos]) == ref)
985 if (pos == GET16D(meta, vdc->Primary_Element_Count))
987 offp = (uint64_t *)&(vdc->Physical_Disk_Sequence[
990 end1 = beg1 + GET64D(meta, vdc->Block_Count);
1245 struct ddf_vdc_record *vdc;
1301 vdc = GETVDCPTR(meta, i);
1302 SET32D(meta, vdc->CRC, 0xffffffff);
1303 SET32D(meta, vdc->CRC, crc32(vdc, size));
1624 if ((vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL)
1669 md_disk_bvd = disk_pos / GET16(vmeta, vdc->Primary_Element_Count); // XXX
1670 md_disk_pos = disk_pos % GET16(vmeta, vdc->Primary_Element_Count); // XXX
1723 (vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) {
1835 struct ddf_vdc_record *vdc;
1844 vdc = vmeta->vdc;
1846 vol->v_raid_level = GET8(vmeta, vdc->Primary_RAID_Level);
1847 vol->v_raid_level_qualifier = GET8(vmeta, vdc->RLQ);
1848 if (GET8(vmeta, vdc->Secondary_Element_Count) > 1 &&
1850 GET8(vmeta, vdc->Secondary_RAID_Level) == 0)
1852 vol->v_sectorsize = GET16(vmeta, vdc->Block_Size);
1855 vol->v_strip_size = vol->v_sectorsize << GET8(vmeta, vdc->Stripe_Size);
1856 vol->v_disks_count = GET16(vmeta, vdc->Primary_Element_Count) *
1857 GET8(vmeta, vdc->Secondary_Element_Count);
1858 vol->v_mdf_pdisks = GET8(vmeta, vdc->MDF_Parity_Disks);
1859 vol->v_mdf_polynomial = GET16(vmeta, vdc->MDF_Parity_Generator_Polynomial);
1860 vol->v_mdf_method = GET8(vmeta, vdc->MDF_Constant_Generation_Method);
1861 if (GET8(vmeta, vdc->Rotate_Parity_count) > 31)
1864 vol->v_rotate_parity = 1 << GET8(vmeta, vdc->Rotate_Parity_count);
1865 vol->v_mediasize = GET64(vmeta, vdc->VD_Size) * vol->v_sectorsize;
1867 if (j == GET16(vmeta, vdc->Primary_Element_Count)) {
1874 sd->sd_size = GET64(vmeta, vdc->Block_Count) *
1889 if (ddf_meta_find_vdc(&pd->pd_meta, vmeta->vdc->VD_GUID) != NULL)
1933 struct ddf_vdc_record *vdc;
1953 vdc = GETVDCPTR(pdmeta, j);
1954 val = GET32D(pdmeta, vdc->Signature);
1962 k = ddf_meta_find_vd(pdmeta, vdc->VD_GUID);
1968 vol = g_raid_md_ddf_get_volume(sc, vdc->VD_GUID);
1985 ddf_vol_meta_update(vmeta, pdmeta, vdc->VD_GUID, pv->pv_started);
1997 if (ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID) == NULL)
2009 for (k = 0; k < GET8(vmeta, vdc->Secondary_Element_Count); k++) {
2011 need += GET16(vmeta, vdc->Primary_Element_Count);
2708 struct ddf_vdc_record *vdc;
2746 SET32(vmeta, vdc->Sequence_Number,
2747 GET32(vmeta, vdc->Sequence_Number) + 1);
2750 SET16(vmeta, vdc->Primary_Element_Count, 2);
2752 SET16(vmeta, vdc->Primary_Element_Count,
2754 SET8(vmeta, vdc->Stripe_Size,
2758 SET8(vmeta, vdc->Primary_RAID_Level,
2760 SET8(vmeta, vdc->RLQ, 0);
2761 SET8(vmeta, vdc->Secondary_Element_Count,
2763 SET8(vmeta, vdc->Secondary_RAID_Level, 0);
2765 SET8(vmeta, vdc->Primary_RAID_Level,
2767 SET8(vmeta, vdc->RLQ,
2769 SET8(vmeta, vdc->Secondary_Element_Count, 1);
2770 SET8(vmeta, vdc->Secondary_RAID_Level, 0);
2772 SET8(vmeta, vdc->Secondary_Element_Seq, 0);
2773 SET64(vmeta, vdc->Block_Count, 0);
2774 SET64(vmeta, vdc->VD_Size, vol->v_mediasize / vol->v_sectorsize);
2775 SET16(vmeta, vdc->Block_Size, vol->v_sectorsize);
2776 SET8(vmeta, vdc->Rotate_Parity_count,
2778 SET8(vmeta, vdc->MDF_Parity_Disks, vol->v_mdf_pdisks);
2779 SET16(vmeta, vdc->MDF_Parity_Generator_Polynomial,
2781 SET8(vmeta, vdc->MDF_Constant_Generation_Method,
2803 bvd = i / GET16(vmeta, vdc->Primary_Element_Count);
2804 pos = i % GET16(vmeta, vdc->Primary_Element_Count);
2816 memcpy(vmeta->bvdc[bvd], vmeta->vdc,
2934 vdc = GETVDCPTR(&pd->pd_meta, i);
2935 if (GET32D(&pd->pd_meta, vdc->Signature) !=
2938 SET32D(&pd->pd_meta, vdc->Signature, 0xffffffff);
2947 vdc = ddf_meta_find_vdc(&pd->pd_meta,
2949 if (vdc == NULL)
2950 vdc = ddf_meta_find_vdc(&pd->pd_meta, NULL);
2951 if (vdc != NULL) {
2953 vdc->Primary_Element_Count);
2954 memcpy(vdc, vmeta->bvdc[bvd],