示例#1
0
DWORD
CNdasLogicalDevice::cpGetMaxRequestBlocks()
{
	ximeta::CAutoLock autolock(this);

	//
	// MaxRequestBlock is a NDAS Device's dependent property
	// So we only have to look at NDAS devices
	//

	DWORD dwMaxRequestBlocks(0);

	for (DWORD i = 0; i < GetUnitDeviceCount(); i++) 
	{
		CRefObjPtr<CNdasUnitDevice> pUnitDevice = GetUnitDevice(i);
		if (NULL == pUnitDevice.p) 
		{
			return 0;
		}

		if (0 == i) 
		{
			dwMaxRequestBlocks = pUnitDevice->GetOptimalMaxRequestBlock();
		}
		else
		{
			dwMaxRequestBlocks = 
				min(dwMaxRequestBlocks, pUnitDevice->GetOptimalMaxRequestBlock());
		}

	}

	m_dwCurrentMRB = dwMaxRequestBlocks;
	return dwMaxRequestBlocks;

}