userlibandfileserver/fileserver/sfat32/sl_mnt.cpp
changeset 176 af6ec97d9189
parent 148 31ea0f8e3c99
child 189 a5496987b1da
child 247 d8d70de2bd36
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Wed Jun 23 11:59:44 2010 +0100
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Wed Jun 23 12:52:28 2010 +0100
@@ -26,6 +26,7 @@
 #include "sl_dir_cache.h"
 #include "sl_scandrv.h"
 #include <hal.h>
+#include <f32dbg.h>
 
 TShortName DoGenerateShortNameL(const TDesC& aLongName,TInt& aNum,TBool aUseTildeSelectively);
 
@@ -1341,9 +1342,10 @@
     FindEntryStartL(RemoveTrailingDots(aName),KEntryAttMaskSupported,firstEntry,firstEntryPos);
     MoveToDosEntryL(firstEntryPos,firstEntry);
     TUint setAttMask=aSetAttMask&KEntryAttMaskSupported;
+	TInt oldAtt = firstEntry.Attributes();
+	TInt att = oldAtt;
     if (setAttMask|aClearAttMask)
         {
-        TInt att=firstEntry.Attributes();
         att|=setAttMask;
         att&=(~aClearAttMask);
         firstEntry.SetAttributes(att);
@@ -1352,6 +1354,8 @@
 		{
 		firstEntry.SetTime(aTime,TimeOffset());
 		}
+	else if (att == oldAtt)
+		return;					// no change - don't bother writing entry
     WriteDirEntryL(firstEntryPos,firstEntry);
     }
 
@@ -3623,23 +3627,36 @@
 		case EDisableFATDirCache:
 			{
 		    MWTCacheInterface* pDirCache = iRawDisk->DirCacheInterface();
-		    TUint32 KEDisableFATDirCache = CDynamicDirCache::EDisableCache;
+		    TUint32 KEDisableFATDirCache = MWTCacheInterface::EDisableCache;
 		    pDirCache->Control(KEDisableFATDirCache, (TUint32) aParam1, NULL);
 			break;
 			}
 		case EDumpFATDirCache:
 			{
 		    MWTCacheInterface* pDirCache = iRawDisk->DirCacheInterface();
-		    TUint32 KEDumpFATDirCache = CDynamicDirCache::EDumpCache;
-		    pDirCache->Control(KEDumpFATDirCache, 0, NULL);
+		    if (pDirCache)
+		        {
+	            TUint32 KEDumpFATDirCache = MWTCacheInterface::EDumpCache;
+	            pDirCache->Control(KEDumpFATDirCache, 0, NULL);
+		        }
 			break;
 			}
 		case EFATDirCacheInfo:
 			{
-		    MWTCacheInterface* pDirCache = iRawDisk->DirCacheInterface();
-		    TUint32 KEFATDirCacheInfo = CDynamicDirCache::ECacheInfo;
-		    pDirCache->Control(KEFATDirCacheInfo, 0, NULL);
-			break;
+			MWTCacheInterface* pDCache = iRawDisk->DirCacheInterface();
+		    if (pDCache)
+		        {
+	            TUint32 KEFATDirCacheInfo = MWTCacheInterface::ECacheInfo;
+	            TDirCacheInfo aInfo;
+	            TInt r = pDCache->Control(KEFATDirCacheInfo, 0, static_cast<TAny*>(&aInfo));
+	            if (r == KErrNone)
+	                {
+	                TPckgBuf<TDirCacheInfo> pkgBuf(aInfo);
+	                r = aMessage.Write(2,pkgBuf);
+	                }
+                return r;
+		        }
+		    return KErrNotSupported;
 			}