Lines Matching refs:pArray

570 	PVDevice pArray,pChild;  in hpt_create_array_v2()  local
591 mArGetArrayTable(pArray); in hpt_create_array_v2()
592 if(!pArray) return INVALID_DEVICEID; in hpt_create_array_v2()
597 pArray->VDeviceType = VD_JBOD; in hpt_create_array_v2()
603 pArray->VDeviceType = VD_RAID_0; in hpt_create_array_v2()
609 pArray->VDeviceType = VD_RAID_5; in hpt_create_array_v2()
612 pArray->u.array.rf_need_rebuild = 1; in hpt_create_array_v2()
618 pArray->VDeviceType = VD_RAID_1; in hpt_create_array_v2()
620 pArray->u.array.bArnMember = pParam->nDisk; in hpt_create_array_v2()
621 pArray->u.array.bArRealnMember = pParam->nDisk; in hpt_create_array_v2()
622 pArray->u.array.bArBlockSizeShift = pParam->BlockSizeShift; in hpt_create_array_v2()
623 pArray->u.array.bStripeWitch = (1 << pParam->BlockSizeShift); in hpt_create_array_v2()
624 pArray->u.array.dArStamp = Stamp; in hpt_create_array_v2()
626 pArray->u.array.rf_need_sync = 1; in hpt_create_array_v2()
627 pArray->u.array.rf_newly_created = 1; in hpt_create_array_v2()
630 (pArray->VDeviceType == VD_RAID_1)) in hpt_create_array_v2()
632 pArray->u.array.rf_newly_created = 0; /* R1 shall still be accessible */ in hpt_create_array_v2()
633 pArray->u.array.rf_need_rebuild = 1; in hpt_create_array_v2()
634 pArray->u.array.rf_auto_rebuild = 1; in hpt_create_array_v2()
635 pArray->u.array.rf_duplicate_and_create = 1; in hpt_create_array_v2()
642 pArray->u.array.RebuildSectors = pArray->u.array.rf_need_rebuild? 0 : MAX_LBA_T; in hpt_create_array_v2()
644 memcpy(pArray->u.array.ArrayName, pParam->ArrayName, MAX_ARRAY_NAME); in hpt_create_array_v2()
648 pArray->u.array.pMember[i] = ID_TO_VDEV(pParam->Members[i]); in hpt_create_array_v2()
649 pArray->u.array.pMember[i]->bSerialNumber = i; in hpt_create_array_v2()
650 pArray->u.array.pMember[i]->pParent = pArray; in hpt_create_array_v2()
654 pArray->VDeviceType!=VD_RAID_1 || in hpt_create_array_v2()
656 UnregisterVDevice(pArray->u.array.pMember[i]); in hpt_create_array_v2()
658 if(pArray->VDeviceType == VD_RAID_5) in hpt_create_array_v2()
659 pArray->u.array.pMember[i]->vf_cache_disk = 1; in hpt_create_array_v2()
691 pArray->u.array.pMember[i] = pChild; in hpt_create_array_v2()
695 pChild->pParent = pArray; in hpt_create_array_v2()
703 pArray->VDeviceType = VD_RAID_0; in hpt_create_array_v2()
705 pArray->u.array.bArnMember = pParam->nDisk / 2; in hpt_create_array_v2()
706 pArray->u.array.bArRealnMember = pParam->nDisk / 2; in hpt_create_array_v2()
707 pArray->u.array.bArBlockSizeShift = pParam->BlockSizeShift; in hpt_create_array_v2()
708 pArray->u.array.bStripeWitch = (1 << pParam->BlockSizeShift); in hpt_create_array_v2()
709 pArray->u.array.dArStamp = Stamp; in hpt_create_array_v2()
711 pArray->u.array.rf_need_sync = 1; in hpt_create_array_v2()
712 pArray->u.array.rf_newly_created = 1; in hpt_create_array_v2()
714 memcpy(pArray->u.array.ArrayName, pParam->ArrayName, MAX_ARRAY_NAME); in hpt_create_array_v2()
722 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
723 pArray->u.array.pMember[i]->pfnDeviceFailed = pfnDeviceFailed[pArray->VDeviceType]; in hpt_create_array_v2()
726 (pArray->VDeviceType == VD_RAID_1)) in hpt_create_array_v2()
728 pArray->vf_bootmark = pArray->u.array.pMember[0]->vf_bootmark; in hpt_create_array_v2()
729 pArray->vf_bootable = pArray->u.array.pMember[0]->vf_bootable; in hpt_create_array_v2()
730 pArray->u.array.pMember[0]->vf_bootable = 0; in hpt_create_array_v2()
731 pArray->u.array.pMember[0]->vf_bootmark = 0; in hpt_create_array_v2()
733 _vbus_p->pVDevice[Loca] = pArray; in hpt_create_array_v2()
735 pArray->u.array.rf_duplicate_and_created = 1; in hpt_create_array_v2()
736 pArray->pVBus = _vbus_p; in hpt_create_array_v2()
750 pArray->vf_online = 1; in hpt_create_array_v2()
751 pArray->pParent = NULL; in hpt_create_array_v2()
753 switch(pArray->VDeviceType) in hpt_create_array_v2()
756 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
757 if(pArray->u.array.pMember[i]->VDeviceCapacity < capacity) in hpt_create_array_v2()
758 capacity = pArray->u.array.pMember[i]->VDeviceCapacity; in hpt_create_array_v2()
762 capacity &= ~(pArray->u.array.bStripeWitch - 1); in hpt_create_array_v2()
764 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
765 if (mIsArray(pArray->u.array.pMember[i])) in hpt_create_array_v2()
766 pArray->u.array.pMember[i]->VDeviceCapacity = capacity; in hpt_create_array_v2()
767 pArray->VDeviceCapacity = capacity * pArray->u.array.bArnMember; in hpt_create_array_v2()
771 pArray->VDeviceCapacity = MIN(pArray->u.array.pMember[0]->VDeviceCapacity, in hpt_create_array_v2()
772 pArray->u.array.pMember[1]->VDeviceCapacity); in hpt_create_array_v2()
776 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
777 pArray->VDeviceCapacity += pArray->u.array.pMember[i]->VDeviceCapacity in hpt_create_array_v2()
785 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
786 if(pArray->u.array.pMember[i]->VDeviceCapacity < capacity) in hpt_create_array_v2()
787 capacity = pArray->u.array.pMember[i]->VDeviceCapacity; in hpt_create_array_v2()
788 pArray->VDeviceCapacity = rounddown2(capacity, pArray->u.array.bStripeWitch) * in hpt_create_array_v2()
789 (pArray->u.array.bArnMember - 1); in hpt_create_array_v2()
796 pArray->pfnSendCommand = pfnSendCommand[pArray->VDeviceType]; in hpt_create_array_v2()
797 pArray->pfnDeviceFailed = fOsDiskFailed; in hpt_create_array_v2()
798 SyncArrayInfo(pArray); in hpt_create_array_v2()
800 if (!pArray->u.array.rf_duplicate_and_created) in hpt_create_array_v2()
801 RegisterVDevice(pArray); in hpt_create_array_v2()
802 return VDEV_TO_ID(pArray); in hpt_create_array_v2()
805 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_create_array_v2()
807 pChild = pArray->u.array.pMember[i]; in hpt_create_array_v2()
811 mArFreeArrayTable(pArray); in hpt_create_array_v2()
912 PVDevice pArray = ID_TO_VDEV(idArray); in hpt_add_disk_to_array() local
916 if(check_VDevice_valid(pArray) || check_VDevice_valid(pDisk)) return -1; in hpt_add_disk_to_array()
917 if(!pArray->u.array.rf_broken) return -1; in hpt_add_disk_to_array()
919 if(pArray->VDeviceType != VD_RAID_1 && pArray->VDeviceType != VD_RAID_5) in hpt_add_disk_to_array()
926 if (pArray->vf_format_v2 && pArray->VDeviceType==VD_RAID_1 && in hpt_add_disk_to_array()
927 pArray->u.array.pMember[0] && in hpt_add_disk_to_array()
928 mIsArray(pArray->u.array.pMember[0])) in hpt_add_disk_to_array()
937 Capacity = pArray->VDeviceCapacity / (pArray->u.array.bArnMember - 1); in hpt_add_disk_to_array()
939 if (pArray->vf_format_v2) { in hpt_add_disk_to_array()
945 if (pArray->pVBus!=_vbus_p) { HPT_ASSERT(0); return -1;} in hpt_add_disk_to_array()
947 for(i = 0; i < pArray->u.array.bArnMember; i++) in hpt_add_disk_to_array()
948 if((pArray->u.array.pMember[i] == 0) || !pArray->u.array.pMember[i]->vf_online) in hpt_add_disk_to_array()
950 if(pArray->u.array.pMember[i] != NULL) in hpt_add_disk_to_array()
951 pArray->u.array.pMember[i]->pParent = NULL; in hpt_add_disk_to_array()
952 pArray->u.array.pMember[i] = pDisk; in hpt_add_disk_to_array()
961 pDisk->pParent = pArray; in hpt_add_disk_to_array()
962 if (pArray->VDeviceType==VD_RAID_5) pDisk->vf_cache_disk = 1; in hpt_add_disk_to_array()
963 pDisk->pfnDeviceFailed = pfnDeviceFailed[pArray->VDeviceType]; in hpt_add_disk_to_array()
964 if (pArray->vf_format_v2) { in hpt_add_disk_to_array()
969 pArray->u.array.bArRealnMember++; in hpt_add_disk_to_array()
970 if(pArray->u.array.bArnMember == pArray->u.array.bArRealnMember) in hpt_add_disk_to_array()
972 pArray->u.array.rf_need_rebuild = 1; in hpt_add_disk_to_array()
973 pArray->u.array.RebuildSectors = 0; in hpt_add_disk_to_array()
974 pArray->u.array.rf_auto_rebuild = 1; in hpt_add_disk_to_array()
975 pArray->u.array.rf_broken = 0; in hpt_add_disk_to_array()
977 pArray->u.array.RebuildSectors = 0; in hpt_add_disk_to_array()
980 while (pArray->pParent) pArray = pArray->pParent; in hpt_add_disk_to_array()
981 pArray->u.array.dArStamp = GetStamp(); in hpt_add_disk_to_array()
982 SyncArrayInfo(pArray); in hpt_add_disk_to_array()