Lines Matching +full:5 +full:vdc
77 struct ddf_vdc_record *vdc; member
224 struct ddf_vdc_record *vdc; in g_raid_md_ddf_print() local
319 vdc = GETVDCPTR(meta, j); in g_raid_md_ddf_print()
320 val = GET32D(meta, vdc->Signature); in g_raid_md_ddf_print()
325 print_guid(vdc->VD_GUID); in g_raid_md_ddf_print()
328 GET32D(meta, vdc->Timestamp)); in g_raid_md_ddf_print()
330 GET32D(meta, vdc->Sequence_Number)); in g_raid_md_ddf_print()
332 GET16D(meta, vdc->Primary_Element_Count)); in g_raid_md_ddf_print()
334 GET8D(meta, vdc->Stripe_Size)); in g_raid_md_ddf_print()
336 GET8D(meta, vdc->Primary_RAID_Level)); in g_raid_md_ddf_print()
338 GET8D(meta, vdc->RLQ)); in g_raid_md_ddf_print()
340 GET8D(meta, vdc->Secondary_Element_Count)); in g_raid_md_ddf_print()
342 GET8D(meta, vdc->Secondary_Element_Seq)); in g_raid_md_ddf_print()
344 GET8D(meta, vdc->Secondary_RAID_Level)); in g_raid_md_ddf_print()
346 GET64D(meta, vdc->Block_Count)); in g_raid_md_ddf_print()
348 GET64D(meta, vdc->VD_Size)); in g_raid_md_ddf_print()
350 GET16D(meta, vdc->Block_Size)); in g_raid_md_ddf_print()
352 GET8D(meta, vdc->Rotate_Parity_count)); in g_raid_md_ddf_print()
355 if (GET32D(meta, vdc->Associated_Spares[i]) != 0xffffffff) in g_raid_md_ddf_print()
356 printf(" 0x%08x", GET32D(meta, vdc->Associated_Spares[i])); in g_raid_md_ddf_print()
360 GET64D(meta, vdc->Cache_Flags)); in g_raid_md_ddf_print()
362 GET8D(meta, vdc->BG_Rate)); in g_raid_md_ddf_print()
364 GET8D(meta, vdc->MDF_Parity_Disks)); in g_raid_md_ddf_print()
366 GET16D(meta, vdc->MDF_Parity_Generator_Polynomial)); in g_raid_md_ddf_print()
368 GET8D(meta, vdc->MDF_Constant_Generation_Method)); in g_raid_md_ddf_print()
370 num2 = GET16D(meta, vdc->Primary_Element_Count); in g_raid_md_ddf_print()
371 val2 = (uint64_t *)&(vdc->Physical_Disk_Sequence[GET16(meta, hdr->Max_Primary_Element_Entries)]); in g_raid_md_ddf_print()
374 GET32D(meta, vdc->Physical_Disk_Sequence[i]), in g_raid_md_ddf_print()
380 vuc = (struct ddf_vuc_record *)vdc; in g_raid_md_ddf_print()
387 sa = (struct ddf_sa_record *)vdc; in g_raid_md_ddf_print()
477 struct ddf_vdc_record *vdc; in ddf_meta_find_vdc() local
482 vdc = GETVDCPTR(meta, i); in ddf_meta_find_vdc()
484 if (GET32D(meta, vdc->Signature) == DDF_VDCR_SIGNATURE && in ddf_meta_find_vdc()
485 memcmp(vdc->VD_GUID, GUID, 24) == 0) in ddf_meta_find_vdc()
486 return (vdc); in ddf_meta_find_vdc()
488 if (GET32D(meta, vdc->Signature) == 0xffffffff || in ddf_meta_find_vdc()
489 GET32D(meta, vdc->Signature) == 0) in ddf_meta_find_vdc()
490 return (vdc); in ddf_meta_find_vdc()
498 struct ddf_vdc_record *vdc; in ddf_meta_count_vdc() local
504 vdc = GETVDCPTR(meta, i); in ddf_meta_count_vdc()
505 if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE) in ddf_meta_count_vdc()
507 if (GUID == NULL || memcmp(vdc->VD_GUID, GUID, 24) == 0) in ddf_meta_count_vdc()
520 for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) { in ddf_meta_find_disk()
522 i += GET16(vmeta, vdc->Primary_Element_Count); // XXX in ddf_meta_find_disk()
862 meta->vdc = malloc(size, M_MD_DDF, M_WAITOK); in ddf_vol_meta_create()
863 memset(meta->vdc, 0xff, size); in ddf_vol_meta_create()
864 SET32(meta, vdc->Signature, DDF_VDCR_SIGNATURE); in ddf_vol_meta_create()
865 memcpy(meta->vdc->VD_GUID, meta->vde->VD_GUID, 24); in ddf_vol_meta_create()
866 SET32(meta, vdc->Sequence_Number, 0); in ddf_vol_meta_create()
874 struct ddf_vdc_record *vdc; in ddf_vol_meta_update() local
879 vdc = ddf_meta_find_vdc(src, GUID); in ddf_vol_meta_update()
880 if (GET8D(src, vdc->Secondary_Element_Count) == 1) in ddf_vol_meta_update()
883 bvd = GET8D(src, vdc->Secondary_Element_Seq); in ddf_vol_meta_update()
886 if (dst->vdc == NULL || in ddf_vol_meta_update()
887 (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) - in ddf_vol_meta_update()
888 GET32(dst, vdc->Sequence_Number))) > 0)) in ddf_vol_meta_update()
894 (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) - in ddf_vol_meta_update()
915 if (dst->vdc != NULL) in ddf_vol_meta_update()
916 free(dst->vdc, M_MD_DDF); in ddf_vol_meta_update()
917 dst->vdc = malloc(size, M_MD_DDF, M_WAITOK); in ddf_vol_meta_update()
918 memcpy(dst->vdc, vdc, size); in ddf_vol_meta_update()
924 memcpy(dst->bvdc[bvd], vdc, size); in ddf_vol_meta_update()
945 if (meta->vdc != NULL) { in ddf_vol_meta_free()
946 free(meta->vdc, M_MD_DDF); in ddf_vol_meta_free()
947 meta->vdc = NULL; in ddf_vol_meta_free()
960 struct ddf_vdc_record *vdc; in ddf_meta_unused_range() local
975 vdc = GETVDCPTR(meta, i); in ddf_meta_unused_range()
976 if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE) in ddf_meta_unused_range()
978 for (pos = 0; pos < GET16D(meta, vdc->Primary_Element_Count); pos++) in ddf_meta_unused_range()
979 if (GET32D(meta, vdc->Physical_Disk_Sequence[pos]) == ref) in ddf_meta_unused_range()
981 if (pos == GET16D(meta, vdc->Primary_Element_Count)) in ddf_meta_unused_range()
983 offp = (uint64_t *)&(vdc->Physical_Disk_Sequence[ in ddf_meta_unused_range()
986 end1 = beg1 + GET64D(meta, vdc->Block_Count); in ddf_meta_unused_range()
1276 struct ddf_vdc_record *vdc; in ddf_meta_write() local
1332 vdc = GETVDCPTR(meta, i); in ddf_meta_write()
1333 SET32D(meta, vdc->CRC, 0xffffffff); in ddf_meta_write()
1334 SET32D(meta, vdc->CRC, crc32(vdc, size)); in ddf_meta_write()
1653 if ((vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) in g_raid_md_ddf_start_disk()
1698 md_disk_bvd = disk_pos / GET16(vmeta, vdc->Primary_Element_Count); // XXX in g_raid_md_ddf_start_disk()
1699 md_disk_pos = disk_pos % GET16(vmeta, vdc->Primary_Element_Count); // XXX in g_raid_md_ddf_start_disk()
1752 (vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) { in g_raid_md_ddf_start_disk()
1873 vol->v_raid_level = GET8(vmeta, vdc->Primary_RAID_Level); in g_raid_md_ddf_start()
1874 vol->v_raid_level_qualifier = GET8(vmeta, vdc->RLQ); in g_raid_md_ddf_start()
1875 if (GET8(vmeta, vdc->Secondary_Element_Count) > 1 && in g_raid_md_ddf_start()
1877 GET8(vmeta, vdc->Secondary_RAID_Level) == 0) in g_raid_md_ddf_start()
1879 vol->v_sectorsize = GET16(vmeta, vdc->Block_Size); in g_raid_md_ddf_start()
1882 vol->v_strip_size = vol->v_sectorsize << GET8(vmeta, vdc->Stripe_Size); in g_raid_md_ddf_start()
1883 vol->v_disks_count = GET16(vmeta, vdc->Primary_Element_Count) * in g_raid_md_ddf_start()
1884 GET8(vmeta, vdc->Secondary_Element_Count); in g_raid_md_ddf_start()
1885 vol->v_mdf_pdisks = GET8(vmeta, vdc->MDF_Parity_Disks); in g_raid_md_ddf_start()
1886 vol->v_mdf_polynomial = GET16(vmeta, vdc->MDF_Parity_Generator_Polynomial); in g_raid_md_ddf_start()
1887 vol->v_mdf_method = GET8(vmeta, vdc->MDF_Constant_Generation_Method); in g_raid_md_ddf_start()
1888 if (GET8(vmeta, vdc->Rotate_Parity_count) > 31) in g_raid_md_ddf_start()
1891 vol->v_rotate_parity = 1 << GET8(vmeta, vdc->Rotate_Parity_count); in g_raid_md_ddf_start()
1892 vol->v_mediasize = GET64(vmeta, vdc->VD_Size) * vol->v_sectorsize; in g_raid_md_ddf_start()
1894 if (j == GET16(vmeta, vdc->Primary_Element_Count)) { in g_raid_md_ddf_start()
1901 sd->sd_size = GET64(vmeta, vdc->Block_Count) * in g_raid_md_ddf_start()
1916 if (ddf_meta_find_vdc(&pd->pd_meta, vmeta->vdc->VD_GUID) != NULL) in g_raid_md_ddf_start()
1960 struct ddf_vdc_record *vdc; in g_raid_md_ddf_new_disk() local
1980 vdc = GETVDCPTR(pdmeta, j); in g_raid_md_ddf_new_disk()
1981 val = GET32D(pdmeta, vdc->Signature); in g_raid_md_ddf_new_disk()
1989 k = ddf_meta_find_vd(pdmeta, vdc->VD_GUID); in g_raid_md_ddf_new_disk()
1995 vol = g_raid_md_ddf_get_volume(sc, vdc->VD_GUID); in g_raid_md_ddf_new_disk()
2012 ddf_vol_meta_update(vmeta, pdmeta, vdc->VD_GUID, pv->pv_started); in g_raid_md_ddf_new_disk()
2024 if (ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID) == NULL) in g_raid_md_ddf_new_disk()
2036 for (k = 0; k < GET8(vmeta, vdc->Secondary_Element_Count); k++) { in g_raid_md_ddf_new_disk()
2038 need += GET16(vmeta, vdc->Primary_Element_Count); in g_raid_md_ddf_new_disk()
2298 return (-5); in g_raid_md_ctl_ddf()
2469 if (numdisks < 5) in g_raid_md_ctl_ddf()
2561 if (strncmp(pp->name, "raid/", 5) == 0 && in g_raid_md_ctl_ddf()
2562 strcmp(pp->name + 5, volname) == 0) in g_raid_md_ctl_ddf()
2618 if (strncmp(diskname, _PATH_DEV, 5) == 0) in g_raid_md_ctl_ddf()
2619 diskname += 5; in g_raid_md_ctl_ddf()
2733 struct ddf_vdc_record *vdc; in g_raid_md_write_ddf() local
2771 SET32(vmeta, vdc->Sequence_Number, in g_raid_md_write_ddf()
2772 GET32(vmeta, vdc->Sequence_Number) + 1); in g_raid_md_write_ddf()
2775 SET16(vmeta, vdc->Primary_Element_Count, 2); in g_raid_md_write_ddf()
2777 SET16(vmeta, vdc->Primary_Element_Count, in g_raid_md_write_ddf()
2779 SET8(vmeta, vdc->Stripe_Size, in g_raid_md_write_ddf()
2783 SET8(vmeta, vdc->Primary_RAID_Level, in g_raid_md_write_ddf()
2785 SET8(vmeta, vdc->RLQ, 0); in g_raid_md_write_ddf()
2786 SET8(vmeta, vdc->Secondary_Element_Count, in g_raid_md_write_ddf()
2788 SET8(vmeta, vdc->Secondary_RAID_Level, 0); in g_raid_md_write_ddf()
2790 SET8(vmeta, vdc->Primary_RAID_Level, in g_raid_md_write_ddf()
2792 SET8(vmeta, vdc->RLQ, in g_raid_md_write_ddf()
2794 SET8(vmeta, vdc->Secondary_Element_Count, 1); in g_raid_md_write_ddf()
2795 SET8(vmeta, vdc->Secondary_RAID_Level, 0); in g_raid_md_write_ddf()
2797 SET8(vmeta, vdc->Secondary_Element_Seq, 0); in g_raid_md_write_ddf()
2798 SET64(vmeta, vdc->Block_Count, 0); in g_raid_md_write_ddf()
2799 SET64(vmeta, vdc->VD_Size, vol->v_mediasize / vol->v_sectorsize); in g_raid_md_write_ddf()
2800 SET16(vmeta, vdc->Block_Size, vol->v_sectorsize); in g_raid_md_write_ddf()
2801 SET8(vmeta, vdc->Rotate_Parity_count, in g_raid_md_write_ddf()
2803 SET8(vmeta, vdc->MDF_Parity_Disks, vol->v_mdf_pdisks); in g_raid_md_write_ddf()
2804 SET16(vmeta, vdc->MDF_Parity_Generator_Polynomial, in g_raid_md_write_ddf()
2806 SET8(vmeta, vdc->MDF_Constant_Generation_Method, in g_raid_md_write_ddf()
2828 bvd = i / GET16(vmeta, vdc->Primary_Element_Count); in g_raid_md_write_ddf()
2829 pos = i % GET16(vmeta, vdc->Primary_Element_Count); in g_raid_md_write_ddf()
2841 memcpy(vmeta->bvdc[bvd], vmeta->vdc, in g_raid_md_write_ddf()
2954 /* Update VDC. */ in g_raid_md_write_ddf()
2959 vdc = GETVDCPTR(&pd->pd_meta, i); in g_raid_md_write_ddf()
2960 if (GET32D(&pd->pd_meta, vdc->Signature) != in g_raid_md_write_ddf()
2963 SET32D(&pd->pd_meta, vdc->Signature, 0xffffffff); in g_raid_md_write_ddf()
2972 vdc = ddf_meta_find_vdc(&pd->pd_meta, in g_raid_md_write_ddf()
2974 if (vdc == NULL) in g_raid_md_write_ddf()
2975 vdc = ddf_meta_find_vdc(&pd->pd_meta, NULL); in g_raid_md_write_ddf()
2976 if (vdc != NULL) { in g_raid_md_write_ddf()
2978 vdc->Primary_Element_Count); in g_raid_md_write_ddf()
2979 memcpy(vdc, vmeta->bvdc[bvd], in g_raid_md_write_ddf()