Lines Matching refs:pArray

568 	PVDevice pArray,pChild;  in hpt_create_array_v2()  local
589 mArGetArrayTable(pArray); in hpt_create_array_v2()
590 if(!pArray) return INVALID_DEVICEID; in hpt_create_array_v2()
595 pArray->VDeviceType = VD_JBOD; in hpt_create_array_v2()
601 pArray->VDeviceType = VD_RAID_0; in hpt_create_array_v2()
607 pArray->VDeviceType = VD_RAID_5; in hpt_create_array_v2()
610 pArray->u.array.rf_need_rebuild = 1; in hpt_create_array_v2()
616 pArray->VDeviceType = VD_RAID_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()
628 (pArray->VDeviceType == VD_RAID_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()
652 pArray->VDeviceType!=VD_RAID_1 || in hpt_create_array_v2()
654 UnregisterVDevice(pArray->u.array.pMember[i]); in hpt_create_array_v2()
656 if(pArray->VDeviceType == VD_RAID_5) in hpt_create_array_v2()
657 pArray->u.array.pMember[i]->vf_cache_disk = 1; in hpt_create_array_v2()
689 pArray->u.array.pMember[i] = pChild; in hpt_create_array_v2()
693 pChild->pParent = pArray; in hpt_create_array_v2()
701 pArray->VDeviceType = VD_RAID_0; 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()
724 (pArray->VDeviceType == VD_RAID_1)) 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()
731 _vbus_p->pVDevice[Loca] = pArray; in hpt_create_array_v2()
733 pArray->u.array.rf_duplicate_and_created = 1; in hpt_create_array_v2()
734 pArray->pVBus = _vbus_p; in hpt_create_array_v2()
748 pArray->vf_online = 1; in hpt_create_array_v2()
749 pArray->pParent = NULL; in hpt_create_array_v2()
751 switch(pArray->VDeviceType) 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()
794 pArray->pfnSendCommand = pfnSendCommand[pArray->VDeviceType]; in hpt_create_array_v2()
795 pArray->pfnDeviceFailed = fOsDiskFailed; in hpt_create_array_v2()
796 SyncArrayInfo(pArray); in hpt_create_array_v2()
798 if (!pArray->u.array.rf_duplicate_and_created) in hpt_create_array_v2()
799 RegisterVDevice(pArray); in hpt_create_array_v2()
800 return VDEV_TO_ID(pArray); 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()
809 mArFreeArrayTable(pArray); in hpt_create_array_v2()
910 PVDevice pArray = ID_TO_VDEV(idArray); in hpt_add_disk_to_array() local
914 if(check_VDevice_valid(pArray) || check_VDevice_valid(pDisk)) return -1; in hpt_add_disk_to_array()
915 if(!pArray->u.array.rf_broken) return -1; in hpt_add_disk_to_array()
917 if(pArray->VDeviceType != VD_RAID_1 && pArray->VDeviceType != VD_RAID_5) in hpt_add_disk_to_array()
924 if (pArray->vf_format_v2 && pArray->VDeviceType==VD_RAID_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()
937 if (pArray->vf_format_v2) { in hpt_add_disk_to_array()
943 if (pArray->pVBus!=_vbus_p) { HPT_ASSERT(0); return -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()
959 pDisk->pParent = pArray; in hpt_add_disk_to_array()
960 if (pArray->VDeviceType==VD_RAID_5) pDisk->vf_cache_disk = 1; in hpt_add_disk_to_array()
961 pDisk->pfnDeviceFailed = pfnDeviceFailed[pArray->VDeviceType]; in hpt_add_disk_to_array()
962 if (pArray->vf_format_v2) { 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()
978 while (pArray->pParent) pArray = pArray->pParent; in hpt_add_disk_to_array()
979 pArray->u.array.dArStamp = GetStamp(); in hpt_add_disk_to_array()
980 SyncArrayInfo(pArray); in hpt_add_disk_to_array()