|
The Pedigree Project 0.1
|
Inheritance diagram for RawFsFile:
Collaboration diagram for RawFsFile:Public Member Functions | |
| RawFsFile (String name, class RawFs *pFs, File *pParent, Disk *pDisk) | |
| virtual bool | sync () |
| virtual bool | sync (size_t offset, bool async) |
| bool | shutdown () |
| virtual uintptr_t | readBlock (uint64_t location) |
| virtual void | writeBlock (uint64_t location, uintptr_t address) |
| virtual bool | pinBlock (uint64_t location) |
| virtual void | unpinBlock (uint64_t location) |
| virtual size_t | getBlockSize () const |
| virtual void | fileAttributeChanged () |
Public Member Functions inherited from File | |
| File () | |
| File (const String &name, Time::Timestamp accessedTime, Time::Timestamp modifiedTime, Time::Timestamp creationTime, uintptr_t inode, class Filesystem *pFs, size_t size, File *pParent) | |
| virtual | ~File () |
| virtual uint64_t | read (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) final |
| size_t | readCached (uint64_t location, size_t size, uintptr_t buffer, bool(*prepare)(uintptr_t, size_t)=nullptr) |
| virtual uint64_t | write (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) final |
| uint64_t | append (uint64_t size, uintptr_t buffer, uint64_t &location, bool bCanBlock=true) |
| WriteGuard | lockWrites () |
| virtual physical_uintptr_t | getPhysicalPage (size_t offset) |
| virtual bool | isDirectPhysicalMapping () const |
| size_t | physicalMappingFlags () const |
| virtual void | returnPhysicalPage (size_t offset) |
| virtual bool | tryBeginMappingRelease () |
| void | endMappingRelease () |
| bool | syncAndReturnPhysicalPage (size_t offset, bool async) |
| bool | syncRange (size_t offset, size_t length) |
| virtual bool | syncPages (const uint64_t *offsets, size_t count) |
| Time::Timestamp | getCreationTime () |
| void | setCreationTime (Time::Timestamp t) |
| Time::Timestamp | getAccessedTime () |
| void | setAccessedTime (Time::Timestamp t) |
| Time::Timestamp | getModifiedTime () |
| void | setModifiedTime (Time::Timestamp t) |
| void | setTimes (Time::Timestamp accessed, Time::Timestamp modified, bool changeAccessed, bool changeModified) |
| virtual Attributes | getAttributes () const |
| virtual XattrStatus | getExtendedAttribute (const StringView &name, void *buffer, size_t capacity, size_t &required) |
| virtual XattrStatus | listExtendedAttributes (void *buffer, size_t capacity, size_t &required) |
| virtual XattrStatus | setExtendedAttribute (const StringView &name, const void *value, size_t length, unsigned flags) |
| virtual XattrStatus | removeExtendedAttribute (const StringView &name) |
| virtual bool | prepareSharedMapping (size_t offset, size_t length) |
| String | getName () const |
| void | getName (String &s) const |
| virtual void | getFullPath (String &result, bool bWithMount=true) |
| virtual String | getFullPath (bool bWithMount=true) |
| virtual void | truncate () |
| bool | resize (size_t size) |
| virtual size_t | getSize () |
| void | setSize (size_t sz) |
| virtual bool | isSymlink () |
| virtual bool | isDirectory () |
| virtual bool | isBlockDevice () const |
| virtual uint64_t | deviceNumber () const |
| virtual bool | isPipe () const |
| virtual bool | isFifo () const |
| virtual bool | isSocket () const |
| virtual bool | isSeekable () const |
| bool | supportsRegularFileOperations () |
| virtual bool | isCharacterDevice () const |
| virtual bool | isConsole () const |
| virtual uint64_t | maximumFileSize () const |
| virtual bool | allowMapping (bool shared, bool writeRequested, bool &mayWrite) |
| bool | acquireMappingUse (bool executable, bool sharedWrite) |
| void | releaseMappingUse (bool executable, bool sharedWrite) |
| uintptr_t | getInode () const |
| virtual void | setInode (uintptr_t inode) |
| virtual uintptr_t | futexIdentity () |
| Filesystem * | getFilesystem () const |
| void | setFilesystem (Filesystem *pFs) |
| void | publishEvent (FileEventMask mask, const StringView &name=StringView(), bool targetIsDirectory=false) |
| virtual FileHandleStatus | subscribeInodeEvents (FileEventMask mask, const SharedPointer< FileEventObserver > &observer, FileEventSubscription &subscription) |
| virtual void | finishInodeRetirement () |
| virtual void | increaseRefCount (bool bIsWriter) |
| virtual void | decreaseRefCount (bool bIsWriter) |
| virtual bool | retainVfsReference () |
| virtual void | releaseVfsReference () |
| virtual bool | isStableVfsRoot () const |
| void | setPermissions (uint32_t perms) |
| uint32_t | getPermissions () const |
| bool | setOwnership (size_t uid, size_t gid, bool changeUid, bool changeGid) |
| void | setUid (size_t uid) |
| size_t | getUid () const |
| void | setGid (size_t gid) |
| size_t | getGid () const |
| File * | getParent () const |
| void | getNamespace (ParentLease &parent, String &name) const |
| virtual int | select (bool bWriting=false, int timeout=0) |
| virtual ReadyMask | queryReady (bool reading, bool writing) |
| virtual bool | supportsReadinessNotifications () const |
| void | monitor (Thread *pThread, Event *pEvent) |
| void | cullMonitorTargets (Thread *pThread) |
| void | cullMonitorTargets (Event *pEvent) |
| virtual bool | supports (const size_t command) const |
| virtual int | command (const size_t command, void *buffer) |
| void | markPageExternallyWritable (size_t offset) |
| size_t | populateRange (size_t offset, size_t length) |
| void | enableDirect () |
| void | disableDirect () |
| virtual void | preallocate (size_t expectedSize, bool zero=true) |
| bool | allocateRange (size_t offset, size_t length, bool keepSize=false) |
| virtual File * | open () |
| virtual File * | openForDescriptor (RetainedFile &owner) |
Public Member Functions inherited from ReadinessSource | |
| MUST_USE_RESULT bool | subscribeReadiness (ReadyMask interest, const SharedPointer< ReadinessObserver > &observer, ReadinessSubscription &subscription) |
| virtual ReadinessGenerations | readinessGenerations () |
Public Member Functions inherited from FileEventSource | |
| MUST_USE_RESULT bool | subscribeFileEvents (FileEventMask interest, const SharedPointer< FileEventObserver > &observer, FileEventSubscription &subscription) |
Private Member Functions | |
| RawFsFile (const RawFsFile &file) | |
| RawFsFile & | operator= (const RawFsFile &) |
Static Private Member Functions | |
| static bool | cacheCallback (CacheConstants::CallbackCause cause, uintptr_t location, uintptr_t page, void *context) |
Private Attributes | |
| Disk * | m_pDisk |
| Cache | m_PageCache |
| Mutex | m_PageCacheLock |
Additional Inherited Members | |
Public Types inherited from File | |
| enum | AttributeMask : uint32_t { AccessTime = 1U << 0 , ModifyTime = 1U << 1 , ChangeTime = 1U << 2 , Owner = 1U << 3 , Group = 1U << 4 , Permissions = 1U << 5 } |
Static Public Attributes inherited from File | |
| static constexpr size_t | MaxReadPages = 32 |
Protected Member Functions inherited from File | |
| bool | tryAcquireFilesystemOperation (OperationBarrier::Lease &operation) const |
| virtual void | updateAttributes (const Attributes &attributes, uint32_t mask) |
| virtual bool | changeOwnership (size_t uid, size_t gid, bool changeUid, bool changeGid) |
| virtual bool | allowPhysicalPage () const |
| virtual bool | prepareWrite (uint64_t location, uint64_t size) |
| virtual bool | allowResize (size_t oldSize, size_t newSize) |
| virtual bool | prepareShrink (const ShrinkContext &context, UniquePointer< PreparedShrink > &prepared) |
| virtual bool | resizeFile (size_t size) |
| virtual bool | allocateFileRange (size_t offset, size_t length) |
| virtual Mutex & | writeSerializationLock () |
| virtual Mutex & | dataMutationLock () |
| virtual size_t & | physicalPageLoans () |
| bool | clearDataCache () |
| virtual bool | isBytewise () const |
| virtual uint64_t | readBytewise (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) |
| virtual uint64_t | writeBytewise (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) |
| virtual bool | readPage (uint64_t location, uintptr_t destination) |
| virtual bool | readPages (ReadPage *pages, size_t count) |
| virtual void | writeBlocks (uint64_t location, uintptr_t addr, size_t length) |
| virtual void | extend (size_t newSize) |
| virtual void | extend (size_t newSize, uint64_t location, uint64_t size) |
| virtual void | publishInodeEvent (const FileEvent &event) |
| void | dataChanged () |
| void | getFilesystemLabel (HugeStaticString &s) |
| void | enableFillCacheWriteback () |
| void | shutdownFillCacheWriteback () |
| bool | syncFillCache (size_t offset, bool async, bool &present) |
| virtual bool | useFillCache () const |
| virtual MUST_USE_RESULT uintptr_t | acquireCachedBlock (uint64_t location, bool retryChanged) |
| void | evict (uint64_t location) |
| void | setPermissionsOnly (uint32_t perms) |
| void | setUidOnly (size_t uid) |
| void | setGidOnly (size_t gid) |
| void | retainDetachedParent () |
| void | moveNamespace (const String &name, File *parent) |
| bool | snapshotNamespace (ParentLease &parent, String &name, FileEventMask interest) const |
| virtual CacheState & | cacheState () |
| void | setPhysicalMappingFlags (size_t flags) |
Protected Member Functions inherited from ReadinessSource | |
| void | notifyReadiness (ReadyMask mask) |
| void | closeReadiness (ReadyMask mask=ReadyInvalid|ReadyHangup) |
Protected Member Functions inherited from FileEventSource | |
| bool | hasFileEventObservers (FileEventMask mask) const |
| void | notifyFileEvent (const FileEvent &event) |
| void | notifyFinalFileEvent (const FileEvent &event) |
| void | beginFinalFileEvent (const FileEvent &event) |
| void | drainFileEvents () |
| void | closeFileEvents () |
Static Protected Member Functions inherited from File | |
| static bool | writeCallback (CacheConstants::CallbackCause cause, uintptr_t loc, uintptr_t page, void *meta) |
| static bool | fillCacheCallback (CacheConstants::CallbackCause cause, uintptr_t loc, uintptr_t page, void *meta) |
Static Protected Member Functions inherited from FileEventSource | |
| static bool | anyFileEventObservers () |
Protected Attributes inherited from File | |
| String | m_Name |
| Time::Timestamp | m_AccessedTime |
| Time::Timestamp | m_ModifiedTime |
| Time::Timestamp | m_CreationTime |
| uintptr_t | m_Inode |
| uintptr_t | m_FutexIdentity = 0 |
| class Filesystem * | m_pFilesystem |
| size_t | m_Size |
| File * | m_pParent |
| Mutex | m_MetadataLock |
| File * | m_pDetachedParent |
| bool | m_bDetachedParentHandled |
| size_t | m_nWriters |
| size_t | m_nReaders |
| size_t | m_Uid |
| size_t | m_Gid |
| uint32_t | m_Permissions |
| CacheState | m_CacheState |
| bool | m_bDirect |
| Mutex | m_WriteLock |
| Mutex | m_DataMutationLock |
| size_t | m_PhysicalPageLoans = 0 |
| size_t | m_PhysicalMappingFlags = 0 |
| Mutex | m_Lock |
| List< MonitorTarget * > | m_MonitorTargets |
Definition at line 32 of file RawFsFile.h.
|
private |
Copy constructors are hidden - unused!
Constructor, should only be called by RawFs.
Definition at line 31 of file RawFsFile.cc.
References Disk::getSize(), and Cache::setCallback().
| RawFsFile::~RawFsFile | ( | ) |
Definition at line 51 of file RawFsFile.cc.
|
staticprivate |
Definition at line 71 of file RawFsFile.cc.
|
inlinevirtual |
Reimplemented from File.
Definition at line 53 of file RawFsFile.h.
|
virtual |
Function to retrieve the block size returned by readBlock.
Reimplemented from File.
Definition at line 87 of file RawFsFile.cc.
References PhysicalMemoryManager::getPageSize().
|
virtual |
Pins the given page.
If your File subclass uses a Cache for readBlock, this method should be implemented to call Cache::pin. The VFS layer calls this method when it determines it is about to give a physical page to an upper layer, and therefore will be unable to guarantee the virtual page's dirty status is a correct reflection of the page's state.
Returns true only when the page currently published for location is held until the matching unpinBlock(). The base implementation returns false so a cache-backed subclass cannot silently claim unsafe pages.
Reimplemented from File.
Definition at line 164 of file RawFsFile.cc.
References PhysicalMemoryManager::getPageSize(), and Cache::pin().
|
virtual |
Retrieves an aligned block with one caller-owned lifetime reference.
Every successful call must be balanced by exactly one unpinBlock() at the same location. Cache-backed implementations must acquire a reference in addition to the cache entry's publication reference on both hit and miss paths.
Reimplemented from File.
Definition at line 93 of file RawFsFile.cc.
References Cache::discardEditing(), PhysicalMemoryManager::getPageSize(), Cache::insert(), Cache::lookup(), Cache::markNoLongerEditing(), Disk::read(), and Disk::unpin().
Referenced by writeBlock().
Here is the caller graph for this function:| bool RawFsFile::shutdown | ( | ) |
Definition at line 67 of file RawFsFile.cc.
|
virtual |
Sync all cached pages for the file back to disk.
Returns false if any cached page cannot be synchronised. Successful pages remain written when another page fails.
Reimplemented from File.
Definition at line 56 of file RawFsFile.cc.
References Cache::syncAll().
|
virtual |
Trigger a sync of an inner cache back to disk and report completion (or queue admission for an asynchronous request).
Reimplemented from File.
Definition at line 60 of file RawFsFile.cc.
References PhysicalMemoryManager::getPageSize(), and Cache::sync().
|
virtual |
Unpins the given page.
Reimplemented from File.
Definition at line 172 of file RawFsFile.cc.
References PhysicalMemoryManager::getPageSize(), and Cache::release().
|
virtual |
Internal function to write a block retrieved with readBlock back to the file. The address of the block is provided for convenience.
Reimplemented from File.
Definition at line 146 of file RawFsFile.cc.
References PhysicalMemoryManager::getPageSize(), Cache::markDirty(), readBlock(), and Cache::release().
|
private |
Definition at line 59 of file RawFsFile.h.
|
private |
Definition at line 60 of file RawFsFile.h.
|
private |
Definition at line 58 of file RawFsFile.h.