userlibandfileserver/fileserver/sfile/sf_file.cpp
branchRCL_3
changeset 41 0ffb4e86fcc9
parent 28 5b5d147c7838
child 42 a179b74831c9
equal deleted inserted replaced
39:2bb754abd467 41:0ffb4e86fcc9
  1012 		// (by CFileShare::RequestStart())
  1012 		// (by CFileShare::RequestStart())
  1013 		if((aNewSize > aInitSize) && (currentOperation.iReadWriteArgs.iTotalLength == 0))
  1013 		if((aNewSize > aInitSize) && (currentOperation.iReadWriteArgs.iTotalLength == 0))
  1014 			{
  1014 			{
  1015 			file->SetNotifyAsyncReadersPending(ETrue);
  1015 			file->SetNotifyAsyncReadersPending(ETrue);
  1016 			}
  1016 			}
  1017 		
       
  1018         file->iAtt |= KEntryAttModified;
       
  1019 
       
  1020 		}
  1017 		}
  1021 	else if (aRetVal == KErrCorrupt)
  1018 	else if (aRetVal == KErrCorrupt)
  1022 		file->SetFileCorrupt(ETrue);
  1019 		file->SetFileCorrupt(ETrue);
  1023 	else if (aRetVal == KErrBadPower || (aRetVal == KErrAbort && !PowerOk()))
  1020 	else if (aRetVal == KErrBadPower || (aRetVal == KErrAbort && !PowerOk()))
  1024 		file->SetBadPower(ETrue);
  1021 		file->SetBadPower(ETrue);
  1664     if ((share->iMode&EFileWrite)==EFalse)
  1661     if ((share->iMode&EFileWrite)==EFalse)
  1665 		return(KErrAccessDenied);
  1662 		return(KErrAccessDenied);
  1666 	
  1663 	
  1667     TUint setAttMask=(TUint)(aRequest->Message().Int0());
  1664     TUint setAttMask=(TUint)(aRequest->Message().Int0());
  1668 	TUint clearAttMask=(TUint)aRequest->Message().Int1();
  1665 	TUint clearAttMask=(TUint)aRequest->Message().Int1();
  1669 	ValidateAtts(share->File().Att(),setAttMask,clearAttMask);
  1666 	ValidateAtts(setAttMask,clearAttMask);
  1670 
  1667 
  1671 	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryL, EF32TraceUidFileSys, &share->File(), 0, 0, setAttMask,clearAttMask);
  1668 	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryL, EF32TraceUidFileSys, &share->File(), 0, 0, setAttMask,clearAttMask);
  1672 	TRAP(r,share->File().SetEntryL(TTime(0),setAttMask,clearAttMask))
  1669 	TRAP(r,share->File().SetEntryL(TTime(0),setAttMask,clearAttMask))
  1673 	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryLRet, EF32TraceUidFileSys, r);
  1670 	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryLRet, EF32TraceUidFileSys, r);
  1674 
  1671 
  1778     TTime time;
  1775     TTime time;
  1779 	TPtr8 t((TUint8*)&time,sizeof(TTime));
  1776 	TPtr8 t((TUint8*)&time,sizeof(TTime));
  1780 	aRequest->ReadL(KMsgPtr0,t);
  1777 	aRequest->ReadL(KMsgPtr0,t);
  1781 	TUint setAttMask=(TUint)(aRequest->Message().Int1()|KEntryAttModified);
  1778 	TUint setAttMask=(TUint)(aRequest->Message().Int1()|KEntryAttModified);
  1782 	TUint clearAttMask=(TUint)aRequest->Message().Int2();
  1779 	TUint clearAttMask=(TUint)aRequest->Message().Int2();
  1783 	ValidateAtts(share->File().Att(),setAttMask,clearAttMask);//	Validate attributes
  1780 	ValidateAtts(setAttMask,clearAttMask);//	Validate attributes
  1784 
  1781 
  1785 	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryL, EF32TraceUidFileSys, &share->File(), 0, 0, setAttMask,clearAttMask);
  1782 	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryL, EF32TraceUidFileSys, &share->File(), 0, 0, setAttMask,clearAttMask);
  1786 	TRAP(r,share->File().SetEntryL(time,setAttMask,clearAttMask))
  1783 	TRAP(r,share->File().SetEntryL(time,setAttMask,clearAttMask))
  1787 	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryLRet, EF32TraceUidFileSys, r);
  1784 	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryLRet, EF32TraceUidFileSys, r);
  1788 
  1785 
  3425 @param aSize The size of the file.
  3422 @param aSize The size of the file.
  3426 @param aDriveLocked The status of the Drive Lock. If it is EFalse,
  3423 @param aDriveLocked The status of the Drive Lock. If it is EFalse,
  3427 the file size shall be modified after acquiring the iLock mutex and if it is ETrue, 
  3424 the file size shall be modified after acquiring the iLock mutex and if it is ETrue, 
  3428 the file size shall be modified without aquiring the iLock mutex.  
  3425 the file size shall be modified without aquiring the iLock mutex.  
  3429 */
  3426 */
  3430 EXPORT_C void CFileCB::SetSize64(TInt64 aSize, TBool aDriveLocked)
  3427 EXPORT_C void CFileCB::SetSize64(TInt64 aSize, TBool /*aDriveLocked*/)
  3431 	{
  3428 	{
  3432 	if(aDriveLocked)
  3429 	// cuurently this should only be called from the drive thread
  3433 		{
  3430 	ASSERT(FsThreadManager::IsDriveThread(Drive().DriveNumber(),EFalse));
  3434 		iSize = (TInt)I64LOW(aSize);
  3431 	iSize = (TInt)I64LOW(aSize);
  3435 		iBody->iSizeHigh = (TInt)I64HIGH(aSize);
  3432 	iBody->iSizeHigh = (TInt)I64HIGH(aSize);
  3436 		}
       
  3437 	else
       
  3438 		{
       
  3439 		Drive().Lock();
       
  3440 		iSize = (TInt)I64LOW(aSize);
       
  3441 		iBody->iSizeHigh = (TInt)I64HIGH(aSize);
       
  3442 		Drive().UnLock();
       
  3443 		}
       
  3444 	}
  3433 	}
  3445 
  3434 
  3446 
  3435 
  3447 /** used to organize key comparison for the TFileShareLock*/
  3436 /** used to organize key comparison for the TFileShareLock*/
  3448 TInt LockOrder(const TFileShareLock& aMatch, const TFileShareLock& anEntry)
  3437 TInt LockOrder(const TFileShareLock& aMatch, const TFileShareLock& anEntry)