--- a/userlibandfileserver/fileserver/sfat32/ram_fat_table32.cpp Thu Aug 19 11:14:22 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/ram_fat_table32.cpp Tue Aug 31 16:34:26 2010 +0300
@@ -343,9 +343,9 @@
Zero fill RAM area corresponding to the cluster number aCluster
@param aCluster a cluster number to be zero-filled
*/
-void CRamFatTable::ZeroFillClusterL(TInt aCluster)
+void CRamFatTable::ZeroFillCluster(TInt aCluster)
{
- TLinAddr clusterPos= I64LOW(DataPositionInBytesL(aCluster));
+ TLinAddr clusterPos= I64LOW(DataPositionInBytes(aCluster));
Mem::FillZ(iRamDiskBase+clusterPos, 1<< iOwner->ClusterSizeLog2());
}
@@ -356,15 +356,9 @@
@param aCluster to find location of
@return Byte offset of the cluster data
*/
-TInt64 CRamFatTable::DataPositionInBytesL(TUint32 aCluster) const
+TInt64 CRamFatTable::DataPositionInBytes(TUint32 aCluster) const
{
//__PRINT(_L("CRamFatTable::DataPositionInBytes"));
- if(!ClusterNumberValid(aCluster))
- {
- __ASSERT_DEBUG(0, Fault(EFatTable_InvalidIndex));
- User::Leave(KErrCorrupt);
- }
-
ReadIndirectionTable(aCluster);
return(aCluster<<iOwner->ClusterSizeLog2());
}
@@ -423,7 +417,7 @@
__PRINT(_L("CRamFatTable::AllocateSingleClusterL"));
iOwner->EnlargeL(1<<iOwner->ClusterSizeLog2()); // First enlarge the RAM drive
TInt fileAllocated=CFatTable::AllocateSingleClusterL(aNearestCluster); // Now update the free cluster and fat/fit
- ZeroFillClusterL(fileAllocated); //-- zero-fill allocated cluster
+ ZeroFillCluster(fileAllocated); //-- zero-fill allocated cluster
return(fileAllocated);
}
@@ -464,7 +458,7 @@
DecrementFreeClusterCount(1);
WriteL(aCluster,freeCluster);
aCluster=freeCluster;
- ZeroFillClusterL(freeCluster); //-- zero fill just allocated cluster (RAM area)
+ ZeroFillCluster(freeCluster); //-- zero fill just allocated cluster (RAM area)
}
SetFreeClusterHint(aCluster);
@@ -499,7 +493,7 @@
endCluster=EOF_32Bit; // endCluster==0 -> file contained FAT loop
// Real position in bytes of the start cluster in the data area
- TLinAddr startClusterPos=I64LOW(DataPositionInBytesL(startCluster));
+ TLinAddr startClusterPos=I64LOW(DataPositionInBytes(startCluster));
// Sliding value when more than one block is freed
TLinAddr trg=startClusterPos-(totalFreed<<clusterShift);
__PRINT1(_L("trg=0x%x"),trg);
@@ -521,7 +515,7 @@
__PRINT1(_L("srcEnd=0x%x"),srcEnd);
}
else // Just move up to the next part of the chain
- srcEnd=I64LOW(DataPositionInBytesL(endCluster));
+ srcEnd=I64LOW(DataPositionInBytes(endCluster));
//-- Copy (srcEnd-srcStart) bytes from iRamDiskBase+srcStart onto iRamDiskBase+trg
//-- zero-filling free space to avoid leaving something important there
@@ -551,7 +545,7 @@
endCluster=EOF_16Bit; // endCluster==0 -> file contained FAT loop
// Real position in bytes of the start cluster in the data area
- TLinAddr startClusterPos=I64LOW(DataPositionInBytesL(startCluster));
+ TLinAddr startClusterPos=I64LOW(DataPositionInBytes(startCluster));
// Sliding value when more than one block is freed
TLinAddr trg=startClusterPos-(totalFreed<<clusterShift);
__PRINT1(_L("trg=0x%x"),trg);
@@ -573,7 +567,7 @@
__PRINT1(_L("srcEnd=0x%x"),srcEnd);
}
else // Just move up to the next part of the chain
- srcEnd=I64LOW(DataPositionInBytesL(endCluster));
+ srcEnd=I64LOW(DataPositionInBytes(endCluster));
//-- Copy (srcEnd-srcStart) bytes from iRamDiskBase+srcStart onto iRamDiskBase+trg
//-- zero-filling free space to avoid leaving something important there
@@ -639,12 +633,12 @@
__PRINT2(_L("CRamFatTable::CountContiguousClustersL() start:%d, max:%d"),aStartCluster, aMaxCount);
TUint32 clusterListLen=1;
TUint32 endCluster=aStartCluster;
- TInt64 endClusterPos=DataPositionInBytesL(endCluster);
+ TInt64 endClusterPos=DataPositionInBytes(endCluster);
while (clusterListLen<aMaxCount)
{
TInt oldCluster=endCluster;
TInt64 oldClusterPos=endClusterPos;
- if (GetNextClusterL(endCluster)==EFalse || (endClusterPos=DataPositionInBytesL(endCluster))!=(oldClusterPos+(1<<iOwner->ClusterSizeLog2())))
+ if (GetNextClusterL(endCluster)==EFalse || (endClusterPos=DataPositionInBytes(endCluster))!=(oldClusterPos+(1<<iOwner->ClusterSizeLog2())))
{
endCluster=oldCluster;
break;