persistentstorage/store/USTOR/UT_COLL.CPP
branchRCL_3
changeset 24 cc28652e0254
parent 23 26645d81f48d
equal deleted inserted replaced
23:26645d81f48d 24:cc28652e0254
   901 		if (ext>=0)
   901 		if (ext>=0)
   902 			return ext;
   902 			return ext;
   903 		}
   903 		}
   904 	return ::ExtentL(Host(),iMark,Coord().Base(),aStream);
   904 	return ::ExtentL(Host(),iMark,Coord().Base(),aStream);
   905 	}
   905 	}
   906 
   906 	
   907 /* relocate a stream into [iFree, aExtent)
   907 /* relocate a stream into [iFree, aExtent)
   908 
   908 
   909 During compaction, for each string which is to be moved from position A1 to B1, the sequence of operations is:
   909 During compaction, for each string which is to be moved from position A1 to B1, the sequence of operations is:
   910 
   910 
   911 1.  Copy stream S1 content from position A1 to position B1 . The copy never overlaps so the old stream content is still good at this point.
   911 1.  Copy stream S1 content from position A1 to position B1 . The copy never overlaps so the old stream content is still good at this point.
   940 
   940 
   941 Based on the knowledge above, it is strongly recommended to set EFileWriteDirectIO bit when opening the file so that the order is maintained
   941 Based on the knowledge above, it is strongly recommended to set EFileWriteDirectIO bit when opening the file so that the order is maintained
   942 when writing to the file.
   942 when writing to the file.
   943 */
   943 */
   944 void CPermanentStoreCollector::RelocateStreamL(const CPermanentStoreCollector::TEntry& aReloc, TInt aExtent)
   944 void CPermanentStoreCollector::RelocateStreamL(const CPermanentStoreCollector::TEntry& aReloc, TInt aExtent)
       
   945 
   945 	{
   946 	{
   946 	if (Coord().Accessed())	// must have exclusive access to relocate the stream
   947 	if (Coord().Accessed())	// must have exclusive access to relocate the stream
   947 		__LEAVE(KErrInUse);
   948 		__LEAVE(KErrInUse);
   948 //
   949 //
   949 	TInt end=RelocateL(aReloc.entry.ref,aReloc.len,aReloc.entry.handle == KHandleTocBase ? EFrameDescriptive16 : EFrameData16, aExtent);
   950 	TInt end=RelocateL(aReloc.entry.ref,aReloc.len,aReloc.entry.handle == KHandleTocBase ? EFrameDescriptive16 : EFrameData16, aExtent);
   950 	//Step 1, 4,....
   951 	//Step 1
   951 	Coord().RelocateL(aReloc.entry.handle, iFree);
   952 	Coord().RelocateL(aReloc.entry.handle, iFree);
   952 	// Step 2 & 3, 5 & 6,...
   953 	// Step 2 & 3
   953 	iCoordGen=Coord().Generation();	// changed by relocation
   954 	iCoordGen=Coord().Generation();	// changed by relocation
   954 	iFree = end;
   955 	iFree = end;
   955 	}
   956 	}
   956 
   957 
   957 TInt CPermanentStoreCollector::RelocateL(TInt aStream, TInt aLength, TFrameType16 aType, TInt aExtent)
   958 TInt CPermanentStoreCollector::RelocateL(TInt aStream, TInt aLength, TFrameType16 aType, TInt aExtent)