diff -r a179b74831c9 -r c1f20ce4abcf userlibandfileserver/fileserver/inc/f32fsys.inl --- a/userlibandfileserver/fileserver/inc/f32fsys.inl Thu Aug 19 11:14:22 2010 +0300 +++ b/userlibandfileserver/fileserver/inc/f32fsys.inl Tue Aug 31 16:34:26 2010 +0300 @@ -270,53 +270,48 @@ __IS_DRIVETHREAD(); iDriveFlags |= ENotifyOff; } + /** - Locks the drive.This function acquires iLock mutex. - */ inline void TDrive::Lock() {iLock.Wait();} + /** - UnLocks the drive.This function signals the iLock mutex. - */ - inline void TDrive::UnLock() {iLock.Signal();} /** - -Gets the reserved space of a drive - @return Amount of space reserved in bytes. - */ - inline TInt TDrive::ReservedSpace() const - {return iReservedSpace;} + { + return iReservedSpace; + } /** - -Reserves a space of a drive. + Reserves space on a drive. The amount of 'reserved space' is subtracted + from the amount of available free space on the volume reported by file system, when the user + queries it. -@param aReservedSpace Amount of space to reserve in bytes. - + @param aReservedSpace Amount of space to reserve in bytes. */ inline void TDrive::SetReservedSpace(const TInt aReservedSpace) - {iReservedSpace=aReservedSpace; } + { + iReservedSpace=aReservedSpace; + } /** - -Sets the rugged flag in the drive object. + Sets the 'rugged mode' flag in the drive object. The file system associated with this TDrive object + can use this flag for changing its behaviour. + For example, FAT file system if this flag is set, operates in 'Rugged FAT' mode, when the performance is + sacrificed for the sake of reliability. -@param Flag to set or clear the rugged flag. -@see IsRugged() - + @param aIsRugged the 'rugged mode' flag. */ - inline void TDrive::SetRugged(TBool aIsRugged) { if (!aIsRugged) @@ -326,17 +321,13 @@ } /** - -Returns whether the current drive is running as rugged Fat -or not.If IsRugged flag is set then in the event of power -failure fat/metadata will be in a valid state if the scandrive -utility is run immediately after. - -@return Is rugged fat flag. + @return 'Is rugged' flag. + See TDrive::SetRugged() */ - inline TBool TDrive::IsRugged() const - {return !(iDriveFlags & ENotRugged); } + { + return !(iDriveFlags & ENotRugged); + } /** @@ -451,64 +442,69 @@ {Drive().SetNotifyOff();} +//--------------------------------------------------------------------------------------------------------------------------------- +/** + + Increment mount's lock counter. This happens on following events: + - RemoveResource() call, when file (share) or directory is closed + - AddDiskAccess() call, when disk access object (like Format or RawDisk access) is opened on the mount. + + See also: CMountCB::LockStatus() +*/ +inline void CMountCB::IncLock() + { + iLockMount++; + } + + +//--------------------------------------------------------------------------------------------------------------------------------- /** -Locks the mount by incrementing the internal lock counter. + Decrement mount's lock counter. This happens on following events: + + AddResource() call when file (share) or directory is opened on the mount + RemoveDiskAccess() call when disk access object (like Format or RawDisk access) is closed. + + See also: CMountCB::LockStatus() +*/ +inline void CMountCB::DecLock() + { + iLockMount--; + } -The mount becomes locked on formatting or on the opening of a resource -(a file or a directory) or raw disk subsession. -A format, resource or raw disk subsession can only be opened if the mount -is not locked. +//--------------------------------------------------------------------------------------------------------------------------------- + +/** + @return value of the Mount's lock counter value. + + The meaning of 'iLockMount' is overloaded a bit, it's value is: + 0 when there are no files, directories, formats and any other objects opened on the mount + >0 when there are disk access objects opened (raw disk access or format) + <0 when there are files or directories opened on the mount, and the value reflects their total number */ -inline void CMountCB::IncLock() - {iLockMount++;} - +inline TInt CMountCB::LockStatus() const + { + return iLockMount; + } -/** -Unlocks the mount by decrementing the internal lock counter. - -The mount becomes locked on formatting or on the opening of a resource -(a file or a directory) or raw disk subsession. -A format, resource or raw disk subsession can only be opened if the mount -is not locked. -*/ -inline void CMountCB::DecLock() - {iLockMount--;} - - - - -/** -Gets the current lock status. - -It delivers the current lock status by returning the internal lock counter. - -@return The current lock status. -*/ -inline TInt CMountCB::LockStatus() const - {return(iLockMount);} - - - - +//--------------------------------------------------------------------------------------------------------------------------------- /** Tests whether the mount is currently locked. A mount is locked when the internal lock counter is greater than zero. -On creation, the lock counter is set to zero. + This happens when a format, resource or raw disk subsession is opened on the mount. -The mount becomes locked on formatting or on the opening of a resource -(a file or a directory) or raw disk subsession. -A format, resource or raw disk subsession can only be opened if the mount -is not locked. + See also: CMountCB::LockStatus() -@return True if the mount is locked, false, otherwise. + @return True if the mount is locked by having disk access objects opened */ inline TBool CMountCB::Locked() const - {return iLockMount>0; } + { + return iLockMount > 0; + } @@ -537,7 +533,9 @@ /** */ inline TInt64 CMountCB::Size() const - {return(iSize);} + { + return iSize; + } @@ -547,14 +545,19 @@ @param aMountNumber - The unique mount number */ const TInt KMountDismounted = 0x80000000; + inline void CMountCB::SetMountNumber(TInt aMountNumber) - { iMountNumber = (aMountNumber &~ KMountDismounted); } + { + iMountNumber = (aMountNumber & ~KMountDismounted); + } /** -Set the mount to be dismounted + Set the mount flag indicating that it is in 'dismounted' state. + The CMountCB object in this case is still alive, but any attempts to access resources on this + mount result in KErrDismounted. */ inline void CMountCB::SetDismounted(TBool aDismounted) { @@ -568,21 +571,23 @@ /** -Returns the unique mount number @return The unique mount number */ inline TInt CMountCB::MountNumber() const - { return(iMountNumber &~ KMountDismounted); } + { + return(iMountNumber &~ KMountDismounted); + } /** -Returns ETrue if the mount is flagged as dismounted. @return ETrue if the mount is flagged as dismounted */ inline TBool CMountCB::IsDismounted() const - { return(iMountNumber & KMountDismounted); } + { + return(iMountNumber & KMountDismounted); + }