Lines Matching full:array
92 if ((pVDevice->u.array.dArStamp != 0) && (pVDevice == p)) in check_VDevice_valid()
120 /* The array is disabled */ in get_array_flag()
127 /* array need synchronizing */ in get_array_flag()
128 if(pVDevice->u.array.rf_need_rebuild && !pVDevice->u.array.rf_duplicate_and_create) in get_array_flag()
131 /* array is in rebuilding process */ in get_array_flag()
132 if(pVDevice->u.array.rf_rebuilding) in get_array_flag()
135 /* array is being verified */ in get_array_flag()
136 if(pVDevice->u.array.rf_verifying) in get_array_flag()
139 /* array is being initialized */ in get_array_flag()
140 if(pVDevice->u.array.rf_initializing) in get_array_flag()
144 if(pVDevice->u.array.rf_broken) in get_array_flag()
147 /* array has a active partition */ in get_array_flag()
151 /* a newly created array */ in get_array_flag()
152 if(pVDevice->u.array.rf_newly_created) in get_array_flag()
155 /* array has boot mark set */ in get_array_flag()
160 if(pVDevice->u.array.rf_auto_rebuild) in get_array_flag()
163 for(i = 0; i < pVDevice->u.array.bArnMember; i++) in get_array_flag()
165 PVDevice pMember = pVDevice->u.array.pMember[i]; in get_array_flag()
169 /* array need synchronizing */ in get_array_flag()
170 if(pMember->u.array.rf_need_rebuild && in get_array_flag()
171 !pMember->u.array.rf_duplicate_and_create) in get_array_flag()
174 /* array is in rebuilding process */ in get_array_flag()
175 if(pMember->u.array.rf_rebuilding) in get_array_flag()
178 /* array is being verified */ in get_array_flag()
179 if(pMember->u.array.rf_verifying) in get_array_flag()
182 /* array is being initialized */ in get_array_flag()
183 if(pMember->u.array.rf_initializing) in get_array_flag()
187 if(pMember->u.array.rf_broken) in get_array_flag()
190 /* a newly created array */ in get_array_flag()
191 if(pMember->u.array.rf_newly_created) in get_array_flag()
195 if(pMember->u.array.rf_auto_rebuild) in get_array_flag()
205 DWORD result = ((ULONG)(pVDevice->u.array.RebuildSectors>>11)*1000 / in calc_rebuild_progress()
206 (ULONG)(pVDevice->VDeviceCapacity>>11) * (pVDevice->u.array.bArnMember-1)) * 10; in calc_rebuild_progress()
208 for(i = 0; i < pVDevice->u.array.bArnMember; i++) in calc_rebuild_progress()
210 PVDevice pMember = pVDevice->u.array.pMember[i]; in calc_rebuild_progress()
215 if (pMember->u.array.rf_rebuilding || in calc_rebuild_progress()
216 pMember->u.array.rf_verifying || in calc_rebuild_progress()
217 pMember->u.array.rf_initializing) in calc_rebuild_progress()
219 DWORD percent = ((ULONG)(pMember->u.array.RebuildSectors>>11)*1000 / in calc_rebuild_progress()
220 (ULONG)(pMember->VDeviceCapacity>>11) * (pMember->u.array.bArnMember-1)) * 10; in calc_rebuild_progress()
234 memcpy(pArrayInfo->Name, pVDevice->u.array.ArrayName, MAX_ARRAY_NAME); in get_array_info()
236 pArrayInfo->BlockSizeShift = pVDevice->u.array.bArBlockSizeShift; in get_array_info()
237 pArrayInfo->RebuiltSectors = pVDevice->u.array.RebuildSectors; in get_array_info()
243 for(i = 0; i < pVDevice->u.array.bArnMember; i++) in get_array_info()
244 if(pVDevice->u.array.pMember[i] != NULL) in get_array_info()
245 pArrayInfo->Members[pArrayInfo->nDisk++] = VDEV_TO_ID(pVDevice->u.array.pMember[i]); in get_array_info()
255 memcpy(pArrayInfo->Name, pVDevice->u.array.ArrayName, MAX_ARRAYNAME_LEN); in get_array_info_v2()
257 pArrayInfo->BlockSizeShift = pVDevice->u.array.bArBlockSizeShift; in get_array_info_v2()
258 pArrayInfo->RebuiltSectors.lo32 = pVDevice->u.array.RebuildSectors; in get_array_info_v2()
259 pArrayInfo->RebuiltSectors.hi32 = sizeof(LBA_T)>4? (pVDevice->u.array.RebuildSectors>>32) : 0; in get_array_info_v2()
265 for(i = 0; i < pVDevice->u.array.bArnMember; i++) in get_array_info_v2()
266 if(pVDevice->u.array.pMember[i] != NULL) in get_array_info_v2()
267 pArrayInfo->Members[pArrayInfo->nDisk++] = VDEV_TO_ID(pVDevice->u.array.pMember[i]); in get_array_info_v2()
524 get_array_info(pVDevice, &pInfo->u.array); in hpt_get_device_info()
549 get_array_info_v2(pVDevice, &pInfo->u.array); in hpt_get_device_info_v2()
610 pArray->u.array.rf_need_rebuild = 1; in hpt_create_array_v2()
618 pArray->u.array.bArnMember = pParam->nDisk; in hpt_create_array_v2()
619 pArray->u.array.bArRealnMember = pParam->nDisk; in hpt_create_array_v2()
620 pArray->u.array.bArBlockSizeShift = pParam->BlockSizeShift; in hpt_create_array_v2()
621 pArray->u.array.bStripeWitch = (1 << pParam->BlockSizeShift); in hpt_create_array_v2()
622 pArray->u.array.dArStamp = Stamp; in hpt_create_array_v2()
624 pArray->u.array.rf_need_sync = 1; in hpt_create_array_v2()
625 pArray->u.array.rf_newly_created = 1; in hpt_create_array_v2()
630 pArray->u.array.rf_newly_created = 0; /* R1 shall still be accessible */ in hpt_create_array_v2()
631 pArray->u.array.rf_need_rebuild = 1; in hpt_create_array_v2()
632 pArray->u.array.rf_auto_rebuild = 1; in hpt_create_array_v2()
633 pArray->u.array.rf_duplicate_and_create = 1; in hpt_create_array_v2()
640 pArray->u.array.RebuildSectors = pArray->u.array.rf_need_rebuild? 0 : MAX_LBA_T; in hpt_create_array_v2()
642 memcpy(pArray->u.array.ArrayName, pParam->ArrayName, MAX_ARRAY_NAME); in hpt_create_array_v2()
646 pArray->u.array.pMember[i] = ID_TO_VDEV(pParam->Members[i]); in hpt_create_array_v2()
647 pArray->u.array.pMember[i]->bSerialNumber = i; in hpt_create_array_v2()
648 pArray->u.array.pMember[i]->pParent = pArray; in hpt_create_array_v2()
654 UnregisterVDevice(pArray->u.array.pMember[i]); in hpt_create_array_v2()
657 pArray->u.array.pMember[i]->vf_cache_disk = 1; in hpt_create_array_v2()
667 pChild->u.array.bArnMember = 2; in hpt_create_array_v2()
668 pChild->u.array.bArRealnMember = 2; in hpt_create_array_v2()
669 pChild->u.array.bArBlockSizeShift = pParam->BlockSizeShift; in hpt_create_array_v2()
670 pChild->u.array.bStripeWitch = (1 << pParam->BlockSizeShift); in hpt_create_array_v2()
671 pChild->u.array.dArStamp = Stamp; in hpt_create_array_v2()
673 pChild->u.array.rf_need_sync = 1; in hpt_create_array_v2()
674 pChild->u.array.rf_newly_created = 1; in hpt_create_array_v2()
676 pChild->u.array.RebuildSectors = MAX_LBA_T; in hpt_create_array_v2()
678 memcpy(pChild->u.array.ArrayName, pParam->ArrayName, MAX_ARRAY_NAME); in hpt_create_array_v2()
682 pChild->u.array.pMember[j] = ID_TO_VDEV(pParam->Members[i*2 + j]); in hpt_create_array_v2()
683 pChild->u.array.pMember[j]->bSerialNumber = j; in hpt_create_array_v2()
684 pChild->u.array.pMember[j]->pParent = pChild; in hpt_create_array_v2()
685 pChild->u.array.pMember[j]->pfnDeviceFailed = pfnDeviceFailed[pChild->VDeviceType]; in hpt_create_array_v2()
686 UnregisterVDevice(pChild->u.array.pMember[j]); in hpt_create_array_v2()
689 pArray->u.array.pMember[i] = pChild; in hpt_create_array_v2()
694 pChild->VDeviceCapacity = MIN(pChild->u.array.pMember[0]->VDeviceCapacity, in hpt_create_array_v2()
695 pChild->u.array.pMember[1]->VDeviceCapacity); in hpt_create_array_v2()
703 pArray->u.array.bArnMember = pParam->nDisk / 2; in hpt_create_array_v2()
704 pArray->u.array.bArRealnMember = pParam->nDisk / 2; in hpt_create_array_v2()
705 pArray->u.array.bArBlockSizeShift = pParam->BlockSizeShift; in hpt_create_array_v2()
706 pArray->u.array.bStripeWitch = (1 << pParam->BlockSizeShift); in hpt_create_array_v2()
707 pArray->u.array.dArStamp = Stamp; in hpt_create_array_v2()
709 pArray->u.array.rf_need_sync = 1; in hpt_create_array_v2()
710 pArray->u.array.rf_newly_created = 1; in hpt_create_array_v2()
712 memcpy(pArray->u.array.ArrayName, pParam->ArrayName, MAX_ARRAY_NAME); in hpt_create_array_v2()
720 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
721 pArray->u.array.pMember[i]->pfnDeviceFailed = pfnDeviceFailed[pArray->VDeviceType]; in hpt_create_array_v2()
726 pArray->vf_bootmark = pArray->u.array.pMember[0]->vf_bootmark; in hpt_create_array_v2()
727 pArray->vf_bootable = pArray->u.array.pMember[0]->vf_bootable; in hpt_create_array_v2()
728 pArray->u.array.pMember[0]->vf_bootable = 0; in hpt_create_array_v2()
729 pArray->u.array.pMember[0]->vf_bootmark = 0; in hpt_create_array_v2()
733 pArray->u.array.rf_duplicate_and_created = 1; in hpt_create_array_v2()
754 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
755 if(pArray->u.array.pMember[i]->VDeviceCapacity < capacity) in hpt_create_array_v2()
756 capacity = pArray->u.array.pMember[i]->VDeviceCapacity; in hpt_create_array_v2()
760 capacity &= ~(pArray->u.array.bStripeWitch - 1); in hpt_create_array_v2()
762 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
763 if (mIsArray(pArray->u.array.pMember[i])) in hpt_create_array_v2()
764 pArray->u.array.pMember[i]->VDeviceCapacity = capacity; in hpt_create_array_v2()
765 pArray->VDeviceCapacity = capacity * pArray->u.array.bArnMember; in hpt_create_array_v2()
769 pArray->VDeviceCapacity = MIN(pArray->u.array.pMember[0]->VDeviceCapacity, in hpt_create_array_v2()
770 pArray->u.array.pMember[1]->VDeviceCapacity); in hpt_create_array_v2()
774 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
775 pArray->VDeviceCapacity += pArray->u.array.pMember[i]->VDeviceCapacity in hpt_create_array_v2()
783 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
784 if(pArray->u.array.pMember[i]->VDeviceCapacity < capacity) in hpt_create_array_v2()
785 capacity = pArray->u.array.pMember[i]->VDeviceCapacity; in hpt_create_array_v2()
786 pArray->VDeviceCapacity = rounddown2(capacity, pArray->u.array.bStripeWitch) * in hpt_create_array_v2()
787 (pArray->u.array.bArnMember - 1); in hpt_create_array_v2()
798 if (!pArray->u.array.rf_duplicate_and_created) in hpt_create_array_v2()
803 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
805 pChild = pArray->u.array.pMember[i]; in hpt_create_array_v2()
844 pArray2 = pArray1->u.array.pMember[1]; in old_add_disk_to_raid01()
849 pArray2->u.array.dArStamp = GetStamp(); in old_add_disk_to_raid01()
851 pArray2->u.array.rf_broken = 1; in old_add_disk_to_raid01()
852 pArray2->u.array.bArBlockSizeShift = pArray1->u.array.bArBlockSizeShift; in old_add_disk_to_raid01()
853 pArray2->u.array.bStripeWitch = (1 << pArray2->u.array.bArBlockSizeShift); in old_add_disk_to_raid01()
854 pArray2->u.array.bArnMember = 2; in old_add_disk_to_raid01()
858 memcpy(pArray2->u.array.ArrayName, pArray1->u.array.ArrayName, MAX_ARRAY_NAME); in old_add_disk_to_raid01()
861 pArray1->u.array.pMember[1] = pArray2; in old_add_disk_to_raid01()
862 pArray1->u.array.bArRealnMember++; in old_add_disk_to_raid01()
865 for(i = 0; i < pArray2->u.array.bArnMember; i++) in old_add_disk_to_raid01()
866 if((pArray2->u.array.pMember[i] == NULL) || !pArray2->u.array.pMember[i]->vf_online) in old_add_disk_to_raid01()
868 if(pArray2->u.array.pMember[i] != NULL) in old_add_disk_to_raid01()
869 pArray2->u.array.pMember[i]->pParent = NULL; in old_add_disk_to_raid01()
870 pArray2->u.array.pMember[i] = pDisk; in old_add_disk_to_raid01()
885 pArray2->u.array.bArRealnMember++; in old_add_disk_to_raid01()
886 if(pArray2->u.array.bArnMember == pArray2->u.array.bArRealnMember){ in old_add_disk_to_raid01()
888 pArray2->u.array.rf_broken = 0; in old_add_disk_to_raid01()
891 if(pArray1->u.array.pMember[0]->vf_online && pArray1->u.array.pMember[1]->vf_online){ in old_add_disk_to_raid01()
892 pArray1->u.array.bArRealnMember = pArray1->u.array.bArnMember; in old_add_disk_to_raid01()
893 pArray1->u.array.rf_broken = 0; in old_add_disk_to_raid01()
894 pArray1->u.array.rf_need_rebuild = 1; in old_add_disk_to_raid01()
895 pArray1->u.array.rf_auto_rebuild = 1; in old_add_disk_to_raid01()
898 pArray1->u.array.RebuildSectors = 0; in old_add_disk_to_raid01()
899 pArray1->u.array.dArStamp = GetStamp(); in old_add_disk_to_raid01()
915 if(!pArray->u.array.rf_broken) return -1; in hpt_add_disk_to_array()
925 pArray->u.array.pMember[0] && in hpt_add_disk_to_array()
926 mIsArray(pArray->u.array.pMember[0])) in hpt_add_disk_to_array()
935 Capacity = pArray->VDeviceCapacity / (pArray->u.array.bArnMember - 1); in hpt_add_disk_to_array()
945 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_add_disk_to_array()
946 if((pArray->u.array.pMember[i] == 0) || !pArray->u.array.pMember[i]->vf_online) in hpt_add_disk_to_array()
948 if(pArray->u.array.pMember[i] != NULL) in hpt_add_disk_to_array()
949 pArray->u.array.pMember[i]->pParent = NULL; in hpt_add_disk_to_array()
950 pArray->u.array.pMember[i] = pDisk; in hpt_add_disk_to_array()
967 pArray->u.array.bArRealnMember++; in hpt_add_disk_to_array()
968 if(pArray->u.array.bArnMember == pArray->u.array.bArRealnMember) in hpt_add_disk_to_array()
970 pArray->u.array.rf_need_rebuild = 1; in hpt_add_disk_to_array()
971 pArray->u.array.RebuildSectors = 0; in hpt_add_disk_to_array()
972 pArray->u.array.rf_auto_rebuild = 1; in hpt_add_disk_to_array()
973 pArray->u.array.rf_broken = 0; in hpt_add_disk_to_array()
975 pArray->u.array.RebuildSectors = 0; in hpt_add_disk_to_array()
977 /* sync the whole array */ in hpt_add_disk_to_array()
979 pArray->u.array.dArStamp = GetStamp(); in hpt_add_disk_to_array()
1033 memset(pVDevice->u.array.ArrayName, 0, MAX_ARRAY_NAME); in hpt_set_array_info()
1034 memcpy(pVDevice->u.array.ArrayName, pInfo->Name, sizeof(pInfo->Name)); in hpt_set_array_info()
1035 pVDevice->u.array.rf_need_sync = 1; in hpt_set_array_info()
1039 memcpy(pVDevice->u.array.Description, pInfo->Description, sizeof(pInfo->Description)); in hpt_set_array_info()
1040 pVDevice->u.array.rf_need_sync = 1; in hpt_set_array_info()
1043 if (pVDevice->u.array.rf_need_sync) in hpt_set_array_info()