userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp
changeset 139 95f71bcdcdb7
parent 90 947f0dc9f7a8
child 140 2ac1c5c27758
equal deleted inserted replaced
109:b3a1d9898418 139:95f71bcdcdb7
   890 
   890 
   891     //-- mount-specific volume parameters queries that might not be handled by CFatMountCB::VolumeL
   891     //-- mount-specific volume parameters queries that might not be handled by CFatMountCB::VolumeL
   892     if(aLevel == EMountVolParamQuery)
   892     if(aLevel == EMountVolParamQuery)
   893         {
   893         {
   894         ASSERT(ConsistentState()); //-- volume state shall be consistent, otherwise its parameters do not make sense
   894         ASSERT(ConsistentState()); //-- volume state shall be consistent, otherwise its parameters do not make sense
       
   895 
       
   896 		// Ram Drives calculate their total / free space based on querying HAL parameters
       
   897 		// in ::VolumeL(). To make all interfaces return consistent results, we need to force
       
   898 		// a fallback to that for RAM drives.
       
   899 		if (iRamDrive)
       
   900 			return (KErrNotSupported);
       
   901 
   895         switch(aOption)
   902         switch(aOption)
   896             {
   903             {
   897             //-- Request a certain amount of free space on the volume.
   904             //-- Request a certain amount of free space on the volume.
   898             case ESQ_RequestFreeSpace:
   905             case ESQ_RequestFreeSpace:
   899                 {
   906                 {
   925                 }
   932                 }
   926         
   933         
   927             //-- A request to obtain size of the mounted volume without blocking (CMountCB::VolumeL() can block).
   934             //-- A request to obtain size of the mounted volume without blocking (CMountCB::VolumeL() can block).
   928             case ESQ_MountedVolumeSize:
   935             case ESQ_MountedVolumeSize:
   929                 {
   936                 {
   930                 if(iRamDrive)
       
   931                     return KErrNotSupported; //-- it requires knowledge of free space on the volume
       
   932     
       
   933                 TUint64* pVal = (TUint64*)aParam; 
   937                 TUint64* pVal = (TUint64*)aParam; 
   934                 *pVal = iSize; //-- physical drive size
   938 		*pVal = iSize; //-- physical drive size
   935 
   939 
   936                 //-- take into account space occupied by FAT table, etc.
   940                 //-- take into account space occupied by FAT table, etc.
   937                 *pVal -= ClusterBasePosition(); 
   941                 *pVal -= ClusterBasePosition(); 
   938                 *pVal=(*pVal >> ClusterSizeLog2()) << ClusterSizeLog2();  //-- round down to cluster size
   942                 *pVal=(*pVal >> ClusterSizeLog2()) << ClusterSizeLog2();  //-- round down to cluster size
   939 
   943