userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp
changeset 131 e880629062dd
parent 90 947f0dc9f7a8
child 140 2ac1c5c27758
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Tue May 04 09:44:26 2010 +0100
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Wed May 05 05:11:16 2010 +0100
@@ -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();