userlibandfileserver/fileserver/sfile/sf_file.cpp
changeset 247 d8d70de2bd36
parent 201 43365a9b78a3
child 259 57b9594f5772
--- a/userlibandfileserver/fileserver/sfile/sf_file.cpp	Tue Jul 06 15:50:07 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_file.cpp	Wed Aug 18 11:08:29 2010 +0300
@@ -970,10 +970,6 @@
         {//-- this call is originated from explicit file write operation. Set 'Archive' attribute and new file time.
         aFile->SetArchiveAttribute(); //-- it will also set KEntryAttModified
         }
-    else
-        {//-- don't touch data and attributes if it is cache flushing dirty data
-        aFile->iAtt |= KEntryAttModified;
-        }
 
 
 	return KErrNone;
@@ -1587,13 +1583,11 @@
 	
 	CFileCB& file=share->File();
 
-	// flush the write cache
-	CFileCache* fileCache = share->File().FileCache();
-	if (fileCache && (r = fileCache->FlushDirty(aRequest)) != CFsRequest::EReqActionComplete)
-		return r;
-	
 	if (size==file.Size64())
+		{
+		file.SetCachedSize64(size);	// Ensure the cache size doesn't exceeed the physical size
 		return(KErrNone);
+		}
 	
 	TBool fileHasGrown = size > file.Size64();
 	if (fileHasGrown)