userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp
changeset 139 95f71bcdcdb7
parent 90 947f0dc9f7a8
child 140 2ac1c5c27758
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Fri May 14 17:13:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Thu May 27 14:17:14 2010 +0300
@@ -892,6 +892,13 @@
     if(aLevel == EMountVolParamQuery)
         {
         ASSERT(ConsistentState()); //-- volume state shall be consistent, otherwise its parameters do not make sense
+
+		// Ram Drives calculate their total / free space based on querying HAL parameters
+		// in ::VolumeL(). To make all interfaces return consistent results, we need to force
+		// a fallback to that for RAM drives.
+		if (iRamDrive)
+			return (KErrNotSupported);
+
         switch(aOption)
             {
             //-- Request a certain amount of free space on the volume.
@@ -927,11 +934,8 @@
             //-- A request to obtain size of the mounted volume without blocking (CMountCB::VolumeL() can block).
             case ESQ_MountedVolumeSize:
                 {
-                if(iRamDrive)
-                    return KErrNotSupported; //-- it requires knowledge of free space on the volume
-    
                 TUint64* pVal = (TUint64*)aParam; 
-                *pVal = iSize; //-- physical drive size
+		*pVal = iSize; //-- physical drive size
 
                 //-- take into account space occupied by FAT table, etc.
                 *pVal -= ClusterBasePosition();