userlibandfileserver/fileserver/sfat32/sl_disk.cpp
changeset 200 73ea206103e6
parent 90 947f0dc9f7a8
equal deleted inserted replaced
152:657f875b013e 200:73ea206103e6
   284 	@param  aMessage	Refrence to server message from request
   284 	@param  aMessage	Refrence to server message from request
   285 	@param  anOffset	Offset into read data to write
   285 	@param  anOffset	Offset into read data to write
   286 
   286 
   287     @leave on error
   287     @leave on error
   288 */
   288 */
   289 void CAtaDisk::ReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const
   289 void CAtaDisk::ReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset, TUint aFlag) const
   290 	{
   290 	{
   291 
   291 
   292 	__PRINT4(_L("CAtaDisk::ReadL() pos:%u:%u, len:%u, offset:%u"), I64HIGH(aPos), I64LOW(aPos), aLength, anOffset);
   292 	__PRINT4(_L("CAtaDisk::ReadL() pos:%u:%u, len:%u, offset:%u"), I64HIGH(aPos), I64LOW(aPos), aLength, anOffset);
   293 	User::LeaveIfError(iDrive.ReadNonCritical(aPos,aLength,aTrg,aMessage,anOffset));
   293 	User::LeaveIfError(iDrive.ReadNonCritical(aPos,aLength,aTrg,aMessage,anOffset, aFlag));
   294 	}
   294 	}
   295 
   295 
   296 //-------------------------------------------------------------------------------------
   296 //-------------------------------------------------------------------------------------
   297 
   297 
   298 /**
   298 /**
   307 	@param aMessage	Refrence to server message from request, contains data
   307 	@param aMessage	Refrence to server message from request, contains data
   308 	@param anOffset	Offset into write data to use in write
   308 	@param anOffset	Offset into write data to use in write
   309 
   309 
   310     @leave on error
   310     @leave on error
   311 */
   311 */
   312 void CAtaDisk::WriteL(TInt64 aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2 &aMessage,TInt anOffset)
   312 void CAtaDisk::WriteL(TInt64 aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2 &aMessage,TInt anOffset, TUint aFlag)
   313 	{
   313 	{
   314     __PRINT4(_L("CAtaDisk::WriteL() pos:%u:%u, len:%u, offset:%u"), I64HIGH(aPos), I64LOW(aPos), aLength, anOffset);
   314     __PRINT4(_L("CAtaDisk::WriteL() pos:%u:%u, len:%u, offset:%u"), I64HIGH(aPos), I64LOW(aPos), aLength, anOffset);
   315 
   315 
   316 	//-- write data to the media directly
   316 	//-- write data to the media directly
   317     User::LeaveIfError(iDrive.WriteNonCritical(aPos,aLength,aSrc,aMessage,anOffset));
   317     User::LeaveIfError(iDrive.WriteNonCritical(aPos,aLength,aSrc,aMessage,anOffset, aFlag));
   318 
   318 
   319     //-- we need to invalidate UID cache page that corresponds to aPos (if any). This is UID caching specific. UID is stored in the first few bytes of 
   319     //-- we need to invalidate UID cache page that corresponds to aPos (if any). This is UID caching specific. UID is stored in the first few bytes of 
   320     //-- the executable module and therefore belongs to one cache page only.
   320     //-- the executable module and therefore belongs to one cache page only.
   321     //-- If someone writes to the beginning of the exe module file, corresponding UID cache page will be invalidated and re-read from the media later
   321     //-- If someone writes to the beginning of the exe module file, corresponding UID cache page will be invalidated and re-read from the media later
   322     iUidCache->InvalidateCachePage(aPos); 
   322     iUidCache->InvalidateCachePage(aPos); 
   442 
   442 
   443 //-------------------------------------------------------------------------------------
   443 //-------------------------------------------------------------------------------------
   444 //
   444 //
   445 // Read from ramDrive into thread relative descriptor
   445 // Read from ramDrive into thread relative descriptor
   446 //
   446 //
   447 void CRamDisk::ReadL(TInt64 aPos,TInt aLength,const TAny* /*aTrg*/,const RMessagePtr2 &aMessage,TInt anOffset) const
   447 void CRamDisk::ReadL(TInt64 aPos,TInt aLength,const TAny* /*aTrg*/,const RMessagePtr2 &aMessage,TInt anOffset, TUint /*aFlag*/) const
   448 	{
   448 	{
   449 	__PRINT2(_L("CRamDisk::ReadL TAny* Pos 0x%x, Len %d"),aPos,aLength);
   449 	__PRINT2(_L("CRamDisk::ReadL TAny* Pos 0x%x, Len %d"),aPos,aLength);
   450 	__ASSERT_ALWAYS((aPos+aLength<=I64INT(iFatMount->Size())) && (aLength>=0),User::Leave(KErrCorrupt));
   450 	__ASSERT_ALWAYS((aPos+aLength<=I64INT(iFatMount->Size())) && (aLength>=0),User::Leave(KErrCorrupt));
   451 	TUint8* pos=RamDiskBase()+I64LOW(aPos);
   451 	TUint8* pos=RamDiskBase()+I64LOW(aPos);
   452 	TPtrC8 buf(pos,aLength);
   452 	TPtrC8 buf(pos,aLength);
   455 
   455 
   456 //-------------------------------------------------------------------------------------
   456 //-------------------------------------------------------------------------------------
   457 //
   457 //
   458 // Write from thread relative descriptor into ramDrive
   458 // Write from thread relative descriptor into ramDrive
   459 //
   459 //
   460 void CRamDisk::WriteL(TInt64 aPos,TInt aLength,const TAny* /*aSrc*/,const RMessagePtr2 &aMessage,TInt anOffset)
   460 void CRamDisk::WriteL(TInt64 aPos,TInt aLength,const TAny* /*aSrc*/,const RMessagePtr2 &aMessage,TInt anOffset, TUint /*aFlag*/)
   461 	{
   461 	{
   462 	__PRINT2(_L("CRamDisk::WriteL TAny* Pos 0x%x, Len %d"),aPos,aLength);
   462 	__PRINT2(_L("CRamDisk::WriteL TAny* Pos 0x%x, Len %d"),aPos,aLength);
   463 	__ASSERT_ALWAYS(aPos+aLength<=I64INT(iFatMount->Size()),User::Leave(KErrCorrupt));
   463 	__ASSERT_ALWAYS(aPos+aLength<=I64INT(iFatMount->Size()),User::Leave(KErrCorrupt));
   464 	TUint8* pos=RamDiskBase()+I64LOW(aPos);
   464 	TUint8* pos=RamDiskBase()+I64LOW(aPos);
   465 	TPtr8 buf(pos,aLength);
   465 	TPtr8 buf(pos,aLength);