userlibandfileserver/fileserver/sfile/sf_dir.cpp
branchRCL_3
changeset 256 c1f20ce4abcf
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
249:a179b74831c9 256:c1f20ce4abcf
    14 // f32\sfile\sf_dir.cpp
    14 // f32\sfile\sf_dir.cpp
    15 // 
    15 // 
    16 //
    16 //
    17 
    17 
    18 #include "sf_std.h"
    18 #include "sf_std.h"
       
    19 
       
    20 #ifdef OST_TRACE_COMPILER_IN_USE
       
    21 #include "sf_dirTraces.h"
       
    22 #endif
    19 
    23 
    20 LOCAL_C CDirCB* GetDirFromHandle(TInt aHandle,CSessionFs* aSession)
    24 LOCAL_C CDirCB* GetDirFromHandle(TInt aHandle,CSessionFs* aSession)
    21 //
    25 //
    22 // Get the dir control block from its handle.
    26 // Get the dir control block from its handle.
    23 //
    27 //
    50 
    54 
    51 	FOREVER
    55 	FOREVER
    52 		{
    56 		{
    53 		TEntry e;
    57 		TEntry e;
    54 
    58 
    55 		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadL, EF32TraceUidFileSys, &aDir);
    59 		OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL2, "fsDirReadPacked this %x", &aDir);
    56 		aDir.ReadL(e);
    60 		aDir.ReadL(e);
    57 		TRACE5(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadLRet, EF32TraceUidFileSys, 
    61 		OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL2RET, "fsDirReadPacked r %d att %x modified %x:%x  size %d", (TUint) KErrNone, (TUint) e.iAtt, (TUint) I64HIGH(e.iModified.Int64()), (TUint) I64LOW(e.iModified.Int64()), (TUint) e.iSize);
    58 			KErrNone, e.iAtt, I64LOW(e.iModified.Int64()), I64HIGH(e.iModified.Int64()), e.iSize);
       
    59 		TInt len=EntrySize(e, EFalse);
    62 		TInt len=EntrySize(e, EFalse);
    60 		TInt rLen=EntrySize(e, ETrue);
    63 		TInt rLen=EntrySize(e, ETrue);
    61 		TEntry* pX=PtrAdd(pE,rLen);
    64 		TEntry* pX=PtrAdd(pE,rLen);
    62 		if (pX>pEnd)
    65 		if (pX>pEnd)
    63 			{
    66 			{
    64 
    67 
    65 			TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBStoreLongEntryNameL, EF32TraceUidFileSys, &aDir);
    68 			OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBSTORELONGENTRYNAMEL, "fsDirReadPacked this %x", &aDir);
    66 			aDir.StoreLongEntryNameL(e.iName);
    69 			aDir.StoreLongEntryNameL(e.iName);
    67 			TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBStoreLongEntryNameLRet, EF32TraceUidFileSys, KErrNone);
    70 			OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBSTORELONGENTRYNAMELRET, "fsDirReadPacked r %d", KErrNone);
    68 
    71 
    69 			aDir.SetPending(ETrue);
    72 			aDir.SetPending(ETrue);
    70 			break;
    73 			break;
    71 			}
    74 			}
    72 		aLen+=rLen;
    75 		aLen+=rLen;
   111 	//DirRead does not have a filename / src stored, so if there are plugins installed which
   114 	//DirRead does not have a filename / src stored, so if there are plugins installed which
   112 	//wish to intercept dirread1/packed then store the name in CDirCB::iName now.
   115 	//wish to intercept dirread1/packed then store the name in CDirCB::iName now.
   113 	CFsPlugin* plugin = NULL;
   116 	CFsPlugin* plugin = NULL;
   114 	//Get the next plugin which is mounted on this drive (IsMounted called in NextPlugin)
   117 	//Get the next plugin which is mounted on this drive (IsMounted called in NextPlugin)
   115 	//Do not check whether we're registered for current operation (in case not registered for EFsDirOpen)
   118 	//Do not check whether we're registered for current operation (in case not registered for EFsDirOpen)
   116 	while(FsPluginManager::NextPlugin(plugin,(CFsMessageRequest*)aRequest,(TBool)ETrue,(TBool)EFalse)==KErrNone && plugin)
   119 	FsPluginManager::ReadLockChain();                                      //!Check operation
       
   120 	while(FsPluginManager::NextPlugin(plugin,(CFsMessageRequest*)aRequest,(TBool)EFalse)==KErrNone && plugin)
   117 		{
   121 		{
   118 		if(plugin->IsRegistered(EFsDirReadOne) ||
   122 		if(plugin->IsRegistered(EFsDirReadOne) ||
   119 			plugin->IsRegistered(EFsDirReadPacked) ||
   123 			plugin->IsRegistered(EFsDirReadPacked) ||
   120 			plugin->IsRegistered(EFsDirSubClose))
   124 			plugin->IsRegistered(EFsDirSubClose))
   121 			{
   125 			{
   124 			r = dir->SetName(&name);
   128 			r = dir->SetName(&name);
   125 			CheckForLeaveAfterOpenL(r, aRequest, h);
   129 			CheckForLeaveAfterOpenL(r, aRequest, h);
   126 			break;
   130 			break;
   127 			}
   131 			}
   128 		}
   132 		}
       
   133 	FsPluginManager::UnlockChain();
   129 	
   134 	
   130 	TPtrC8 pH((TUint8*)&h,sizeof(TInt));
   135 	TPtrC8 pH((TUint8*)&h,sizeof(TInt));
   131 	TRAP(r,aRequest->WriteL(KMsgPtr3,pH))
   136 	TRAP(r,aRequest->WriteL(KMsgPtr3,pH))
   132 	CheckForLeaveAfterOpenL(r, aRequest, h);
   137 	CheckForLeaveAfterOpenL(r, aRequest, h);
   133 	aRequest->Session()->IncResourceCount();
   138 	aRequest->Session()->IncResourceCount();
   161 	TInt r=dir->CheckMount();
   166 	TInt r=dir->CheckMount();
   162 	if (r!=KErrNone)
   167 	if (r!=KErrNone)
   163 		return(r);
   168 		return(r);
   164 	TEntry e;
   169 	TEntry e;
   165 
   170 
   166 	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadL, EF32TraceUidFileSys, &dir);
   171 	OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL1, "this %x", &dir);
   167 	TRAP(r,dir->ReadL(e))
   172 	TRAP(r,dir->ReadL(e))
   168 	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadLRet, EF32TraceUidFileSys, 
   173 	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL1RET, "r %d att %x modified %x:%x  size %d", (TUint) KErrNone, (TUint) e.iAtt, (TUint) I64HIGH(e.iModified.Int64()), (TUint) I64LOW(e.iModified.Int64()), (TUint) e.iSize);
   169 		KErrNone, e.iAtt, I64LOW(e.iModified.Int64()), I64HIGH(e.iModified.Int64()), e.iSize);
   174 		
   170 
   175 
   171 
   176 
   172 	if (r==KErrNone)
   177 	if (r==KErrNone)
   173 		{
   178 		{
   174 		TPckgC<TEntry> pE(e);
   179 		TPckgC<TEntry> pE(e);