1024 // (by CFileShare::RequestStart()) |
1024 // (by CFileShare::RequestStart()) |
1025 if((aNewSize > aInitSize) && (currentOperation.iReadWriteArgs.iTotalLength == 0)) |
1025 if((aNewSize > aInitSize) && (currentOperation.iReadWriteArgs.iTotalLength == 0)) |
1026 { |
1026 { |
1027 file->SetNotifyAsyncReadersPending(ETrue); |
1027 file->SetNotifyAsyncReadersPending(ETrue); |
1028 } |
1028 } |
1029 |
|
1030 file->iAtt |= KEntryAttModified; |
|
1031 |
|
1032 } |
1029 } |
1033 else if (aRetVal == KErrCorrupt) |
1030 else if (aRetVal == KErrCorrupt) |
1034 file->SetFileCorrupt(ETrue); |
1031 file->SetFileCorrupt(ETrue); |
1035 else if (aRetVal == KErrBadPower || (aRetVal == KErrAbort && !PowerOk())) |
1032 else if (aRetVal == KErrBadPower || (aRetVal == KErrAbort && !PowerOk())) |
1036 file->SetBadPower(ETrue); |
1033 file->SetBadPower(ETrue); |
1684 if ((share->iMode&EFileWrite)==EFalse) |
1681 if ((share->iMode&EFileWrite)==EFalse) |
1685 return(KErrAccessDenied); |
1682 return(KErrAccessDenied); |
1686 |
1683 |
1687 TUint setAttMask=(TUint)(aRequest->Message().Int0()); |
1684 TUint setAttMask=(TUint)(aRequest->Message().Int0()); |
1688 TUint clearAttMask=(TUint)aRequest->Message().Int1(); |
1685 TUint clearAttMask=(TUint)aRequest->Message().Int1(); |
1689 ValidateAtts(share->File().Att(),setAttMask,clearAttMask); |
1686 ValidateAtts(setAttMask,clearAttMask); |
1690 OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL1, "this %x aSetAttMask %x aClearAttMask %x", (TUint) &share->File(), (TUint) setAttMask, (TUint) clearAttMask); |
1687 OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL1, "this %x aSetAttMask %x aClearAttMask %x", (TUint) &share->File(), (TUint) setAttMask, (TUint) clearAttMask); |
1691 TRAP(r,share->File().SetEntryL(TTime(0),setAttMask,clearAttMask)) |
1688 TRAP(r,share->File().SetEntryL(TTime(0),setAttMask,clearAttMask)) |
1692 OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL1RET, "r %d", r); |
1689 OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL1RET, "r %d", r); |
1693 return(r); |
1690 return(r); |
1694 } |
1691 } |
1794 TTime time; |
1791 TTime time; |
1795 TPtr8 t((TUint8*)&time,sizeof(TTime)); |
1792 TPtr8 t((TUint8*)&time,sizeof(TTime)); |
1796 aRequest->ReadL(KMsgPtr0,t); |
1793 aRequest->ReadL(KMsgPtr0,t); |
1797 TUint setAttMask=(TUint)(aRequest->Message().Int1()|KEntryAttModified); |
1794 TUint setAttMask=(TUint)(aRequest->Message().Int1()|KEntryAttModified); |
1798 TUint clearAttMask=(TUint)aRequest->Message().Int2(); |
1795 TUint clearAttMask=(TUint)aRequest->Message().Int2(); |
1799 ValidateAtts(share->File().Att(),setAttMask,clearAttMask);// Validate attributes |
1796 ValidateAtts(setAttMask,clearAttMask);// Validate attributes |
1800 |
1797 |
1801 OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL3, "this %x aSetAttMask %x aClearAttMask %x", (TUint) &share->File(), (TUint) setAttMask, (TUint) clearAttMask); |
1798 OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL3, "this %x aSetAttMask %x aClearAttMask %x", (TUint) &share->File(), (TUint) setAttMask, (TUint) clearAttMask); |
1802 TRAP(r,share->File().SetEntryL(time,setAttMask,clearAttMask)) |
1799 TRAP(r,share->File().SetEntryL(time,setAttMask,clearAttMask)) |
1803 OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL3RET, "r %d", r); |
1800 OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL3RET, "r %d", r); |
1804 return(r); |
1801 return(r); |
3442 @param aSize The size of the file. |
3439 @param aSize The size of the file. |
3443 @param aDriveLocked The status of the Drive Lock. If it is EFalse, |
3440 @param aDriveLocked The status of the Drive Lock. If it is EFalse, |
3444 the file size shall be modified after acquiring the iLock mutex and if it is ETrue, |
3441 the file size shall be modified after acquiring the iLock mutex and if it is ETrue, |
3445 the file size shall be modified without aquiring the iLock mutex. |
3442 the file size shall be modified without aquiring the iLock mutex. |
3446 */ |
3443 */ |
3447 EXPORT_C void CFileCB::SetSize64(TInt64 aSize, TBool aDriveLocked) |
3444 EXPORT_C void CFileCB::SetSize64(TInt64 aSize, TBool /*aDriveLocked*/) |
3448 { |
3445 { |
3449 if(aDriveLocked) |
3446 // cuurently this should only be called from the drive thread |
3450 { |
3447 ASSERT(FsThreadManager::IsDriveThread(Drive().DriveNumber(),EFalse)); |
3451 iSize = (TInt)I64LOW(aSize); |
3448 iSize = (TInt)I64LOW(aSize); |
3452 iBody->iSizeHigh = (TInt)I64HIGH(aSize); |
3449 iBody->iSizeHigh = (TInt)I64HIGH(aSize); |
3453 } |
|
3454 else |
|
3455 { |
|
3456 Drive().Lock(); |
|
3457 iSize = (TInt)I64LOW(aSize); |
|
3458 iBody->iSizeHigh = (TInt)I64HIGH(aSize); |
|
3459 Drive().UnLock(); |
|
3460 } |
|
3461 } |
3450 } |
3462 |
3451 |
3463 |
3452 |
3464 /** used to organize key comparison for the TFileShareLock*/ |
3453 /** used to organize key comparison for the TFileShareLock*/ |
3465 TInt LockOrder(const TFileShareLock& aMatch, const TFileShareLock& anEntry) |
3454 TInt LockOrder(const TFileShareLock& aMatch, const TFileShareLock& anEntry) |