|
The Pedigree Project 0.1
|
#include <FatSymlink.h>
Inheritance diagram for FatSymlink:
Collaboration diagram for FatSymlink:Public Member Functions | |
| FatSymlink (String name, Time::Timestamp accessedTime, Time::Timestamp modifiedTime, Time::Timestamp creationTime, uintptr_t inode, class Filesystem *pFs, size_t size, uint32_t dirClus=0, uint32_t dirOffset=0, File *pParent=0) | |
| void | fileAttributeChanged () override |
| bool | sync () override |
| bool | sync (size_t, bool) override |
| Attributes | getAttributes () const override |
| uint32_t | getDirCluster () |
| void | setDirCluster (uint32_t custom) |
| uint32_t | getDirOffset () |
| void | setDirOffset (uint32_t custom) |
| uint64_t | readBytewise (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) override |
| uint64_t | writeBytewise (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) override |
Public Member Functions inherited from Symlink | |
| Symlink () | |
| Symlink (const Symlink &file) | |
| Symlink (const String &name, Time::Timestamp accessedTime, Time::Timestamp modifiedTime, Time::Timestamp creationTime, uintptr_t inode, class Filesystem *pFs, size_t size, File *pParent) | |
| virtual | ~Symlink () |
| virtual bool | isSymlink () |
| virtual int | followLink (char *pBuffer, size_t bufLen) |
| virtual File * | followLinkRetained (Directory::ChildLease &result) |
| virtual bool | isPathLink () const |
| virtual bool | followPath (FilesystemPathRef &) |
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 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 | 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) |
| virtual size_t | getBlockSize () const |
| 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 Attributes | |
| bool | m_Unlinked = false |
| uint32_t | m_DirClus |
| uint32_t | m_DirOffset |
Friends | |
| class | FatFilesystem |
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 Member Functions inherited from Symlink | |
| static Symlink * | fromFile (File *pF) |
Static Public Attributes inherited from File | |
| static constexpr size_t | MaxReadPages = 32 |
Protected Member Functions inherited from Symlink | |
| void | initialise (bool bForce=false) |
| virtual bool | isBytewise () const |
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 uintptr_t | readBlock (uint64_t location) |
| virtual bool | readPage (uint64_t location, uintptr_t destination) |
| virtual bool | readPages (ReadPage *pages, size_t count) |
| virtual void | writeBlock (uint64_t location, uintptr_t addr) |
| 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 bool | pinBlock (uint64_t location) |
| virtual MUST_USE_RESULT uintptr_t | acquireCachedBlock (uint64_t location, bool retryChanged) |
| virtual void | unpinBlock (uint64_t location) |
| 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 Symlink | |
| static File * | retainTarget (File *target, Directory::ChildLease &result) |
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 Symlink | |
| String | m_sTarget |
| Mutex | m_TargetLock |
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 |
FAT Symlink.
FAT itself does not support symlinks, so a Pedigree-specific extension has been used. A filename with a suffix of '.__sym' will be turned into a symlink and its contents will be considered the target of the link.
Definition at line 38 of file FatSymlink.h.
| FatSymlink::FatSymlink | ( | String | name, |
| Time::Timestamp | accessedTime, | ||
| Time::Timestamp | modifiedTime, | ||
| Time::Timestamp | creationTime, | ||
| uintptr_t | inode, | ||
| class Filesystem * | pFs, | ||
| size_t | size, | ||
| uint32_t | dirClus = 0, |
||
| uint32_t | dirOffset = 0, |
||
| File * | pParent = 0 |
||
| ) |
Definition at line 26 of file FatSymlink.cc.
|
override |
Definition at line 66 of file FatSymlink.cc.
|
overridevirtual |
Reimplemented from File.
Definition at line 269 of file FatFilesystem-attributes.cc.
|
overridevirtual |
Reimplemented from File.
Definition at line 44 of file FatSymlink.cc.
|
inline |
Definition at line 52 of file FatSymlink.h.
|
inline |
Definition at line 58 of file FatSymlink.h.
|
overridevirtual |
Reads from the file.
| [in] | buffer | Buffer to write the read data into. Can be null, in which case the data can be found by calling getPhysicalPage. |
| [in] | bCanBlock | Whether or not the File can block when reading |
Reimplemented from File.
Definition at line 38 of file FatSymlink.cc.
|
inline |
Definition at line 55 of file FatSymlink.h.
|
inline |
Definition at line 61 of file FatSymlink.h.
|
overridevirtual |
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 290 of file FatFilesystem-attributes.cc.
Referenced by sync().
Here is the caller graph for this function:
|
inlineoverridevirtual |
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 48 of file FatSymlink.h.
References sync().
|
overridevirtual |
Writes to the file.
| [in] | bCanBlock | Whether or not the File can block when reading |
Reimplemented from File.
Definition at line 54 of file FatSymlink.cc.
References Symlink::initialise(), and Symlink::m_TargetLock.
|
friend |
Definition at line 39 of file FatSymlink.h.
|
private |
Definition at line 80 of file FatSymlink.h.
|
private |
Definition at line 81 of file FatSymlink.h.
|
private |
Definition at line 79 of file FatSymlink.h.