userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp
changeset 247 d8d70de2bd36
parent 200 73ea206103e6
child 266 0008ccd16016
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
   216 @leave  if write error occured.        
   216 @leave  if write error occured.        
   217 */
   217 */
   218 void CFatMountCB::SetVolumeCleanL(TBool aClean) 
   218 void CFatMountCB::SetVolumeCleanL(TBool aClean) 
   219     {
   219     {
   220 
   220 
   221 	//-- The volume can't be set clean if there are objects opened on it. This precondition must be checked before calling this function
   221 	//-- The volume can't be set clean if there are disk access objects opened on it. This precondition must be checked before calling this function
   222     if(aClean && LockStatus()!=0)
   222     if(aClean && Locked())
   223         {
   223         {
   224         __PRINT1(_L("#- CFatMountCB::SetVolumeCleanL drive:%d isn't free!"),DriveNumber());
   224         __PRINT1(_L("#- CFatMountCB::SetVolumeCleanL drive:%d isn't free!"),DriveNumber());
   225         ASSERT(0);
   225         ASSERT(0);
   226         User::Leave(KErrInUse);
   226         User::Leave(KErrInUse);
   227         return;
   227         return;
   933         
   933         
   934             //-- 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).
   935             case ESQ_MountedVolumeSize:
   935             case ESQ_MountedVolumeSize:
   936                 {
   936                 {
   937                 TUint64* pVal = (TUint64*)aParam; 
   937                 TUint64* pVal = (TUint64*)aParam; 
   938 		*pVal = iSize; //-- physical drive size
   938                 *pVal = VolumeSizeInBytes();
   939 
       
   940                 //-- take into account space occupied by FAT table, etc.
       
   941                 *pVal -= ClusterBasePosition(); 
       
   942                 *pVal=(*pVal >> ClusterSizeLog2()) << ClusterSizeLog2();  //-- round down to cluster size
       
   943 
       
   944                 __PRINT1(_L("MountControl() MountedVolumeSize:%LU"), *pVal);
   939                 __PRINT1(_L("MountControl() MountedVolumeSize:%LU"), *pVal);
   945                 return KErrNone;
   940                 return KErrNone;
   946                 }
   941                 }
   947 
   942 
   948             default:
   943             default: