The Pedigree Project 0.1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
SysFs Class Referencefinal
+ Inheritance diagram for SysFs:
+ Collaboration diagram for SysFs:

Public Member Functions

bool initialise (Disk *) override
 
File * getRoot () const override
 
const String & getVolumeLabel () const override
 
SyncStatus sync () override
 
uintptr_t allocateInode ()
 
- Public Member Functions inherited from Filesystem
 Filesystem ()
 
virtual ~Filesystem ()
 
virtual File * find (const StringView &path)
 
virtual File * find (const String &path)
 
virtual File * find (const StringView &path, File *pStartNode)
 
virtual File * find (const String &path, File *pStartNode)
 
File * findRetained (const StringView &path, Directory::ChildLease &result, File *pStartNode=nullptr)
 
virtual bool getUuid (String &uuid) const
 
virtual FileHandleStatus encodeFileHandle (File &file, FileHandle &handle)
 
virtual FileHandleStatus decodeFileHandle (const FileHandle &handle, RetainedFile &file)
 
virtual FileHandleStatus fileHandleFsid (FileSystemId &id)
 
virtual SyncStatus shutdown ()
 
virtual QuotaStatus quotaControl (const QuotaRequest &, QuotaResponse &, File *quotaFile=nullptr)
 
bool createFile (const StringView &path, uint32_t mask, File *pStartNode=0)
 
bool createDirectory (const StringView &path, uint32_t mask, File *pStartNode=0)
 
bool createSymlink (const StringView &path, const String &value, File *pStartNode=0)
 
bool createLink (const StringView &path, File *target, File *pStartNode=0)
 
bool remove (const StringView &path, File *pStartNode=0)
 
bool remove (const StringView &path, File *pStartNode, File *expected)
 
bool rename (const StringView &oldPath, File *oldStart, const StringView &newPath, File *newStart, bool noReplace=false)
 
Disk * getDisk ()
 
bool isReadOnly ()
 
virtual bool isCaseSensitive ()
 
bool remove (File *parent, File *file)
 

Protected Member Functions

bool createFile (File *, const String &, uint32_t) override
 
bool createDirectory (File *, const String &, uint32_t) override
 
bool createSymlink (File *, const String &, const String &) override
 
bool removeNode (File *, const String &, File *) override
 
- Protected Member Functions inherited from Filesystem
virtual bool createLink (File *parent, const String &filename, File *target)
 
virtual bool renameNode (Directory *oldParent, const String &oldName, File *source, Directory *newParent, const String &newName, File *replaced)
 

Private Member Functions

SysFsDirectory * directory (SysFsDirectory *parent, const char *name)
 
void attribute (SysFsDirectory *parent, const char *name, const String &contents)
 
void symlink (SysFsDirectory *parent, const char *name, const String &target)
 
void addPciDevices (SysFsDirectory *devices)
 
void addBlockDevices (SysFsDirectory *devices)
 
void addNetworkDevices (SysFsDirectory *devices)
 

Private Attributes

SysFsDirectory * m_Root
 
Atomic< uintptr_t > m_NextInode
 

Additional Inherited Members

- Public Types inherited from Filesystem
enum class  SyncStatus { Success , Unsupported , NoMemory , IoError }
 
typedef Filesystem *(* ProbeCallback) (Disk *)
 
- Protected Attributes inherited from Filesystem
bool m_bReadOnly
 
Disk * m_pDisk
 
DiskUse m_DiskUse
 

Detailed Description

Definition at line 22 of file SysFs.h.

Constructor & Destructor Documentation

◆ SysFs()

SysFs::SysFs ( )
inline

Definition at line 24 of file SysFs.h.

◆ ~SysFs()

SysFs::~SysFs ( )
override

Definition at line 85 of file SysFs.cc.

Member Function Documentation

◆ addBlockDevices()

void SysFs::addBlockDevices ( SysFsDirectory *  devices)
private

Definition at line 156 of file SysFs.cc.

◆ addNetworkDevices()

void SysFs::addNetworkDevices ( SysFsDirectory *  devices)
private

Definition at line 181 of file SysFs.cc.

◆ addPciDevices()

void SysFs::addPciDevices ( SysFsDirectory *  devices)
private

Definition at line 119 of file SysFs.cc.

◆ allocateInode()

uintptr_t SysFs::allocateInode ( )
inline

Definition at line 36 of file SysFs.h.

◆ attribute()

void SysFs::attribute ( SysFsDirectory *  parent,
const char *  name,
const String &  contents 
)
private

Definition at line 106 of file SysFs.cc.

◆ createDirectory()

bool SysFs::createDirectory ( File *  parent,
const String &  filename,
uint32_t  mask 
)
inlineoverrideprotectedvirtual

createDirectory calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 44 of file SysFs.h.

◆ createFile()

bool SysFs::createFile ( File *  parent,
const String &  filename,
uint32_t  mask 
)
inlineoverrideprotectedvirtual

createFile calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 41 of file SysFs.h.

◆ createSymlink()

bool SysFs::createSymlink ( File *  parent,
const String &  filename,
const String &  value 
)
inlineoverrideprotectedvirtual

createSymlink calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 47 of file SysFs.h.

◆ directory()

SysFsDirectory * SysFs::directory ( SysFsDirectory *  parent,
const char *  name 
)
private

Definition at line 98 of file SysFs.cc.

◆ getRoot()

File * SysFs::getRoot ( ) const
inlineoverridevirtual

Returns the root filesystem node.

Implements Filesystem.

Definition at line 28 of file SysFs.h.

◆ getVolumeLabel()

const String & SysFs::getVolumeLabel ( ) const
overridevirtual

Returns a string identifying the volume label.

Implements Filesystem.

Definition at line 93 of file SysFs.cc.

◆ initialise()

bool SysFs::initialise ( Disk *  pDisk)
overridevirtual

Populates this filesystem with data from the given Disk device.

Returns
true on success, false on failure.

Implements Filesystem.

Definition at line 212 of file SysFs.cc.

References VFS::instance(), and VFS::trackFile().

◆ removeNode()

bool SysFs::removeNode ( File *  parent,
const String &  filename,
File *  file 
)
inlineoverrideprotectedvirtual

Remove a backing node while the VFS holds the parent's namespace lock. A successful implementation must retire the parent's cached entry before returning and must recheck directory emptiness while holding the child's namespace lock.

Implements Filesystem.

Definition at line 50 of file SysFs.h.

◆ symlink()

void SysFs::symlink ( SysFsDirectory *  parent,
const char *  name,
const String &  target 
)
private

Definition at line 112 of file SysFs.cc.

◆ sync()

SyncStatus SysFs::sync ( )
inlineoverridevirtual

Completes data, metadata and device writeback for changes made before entry.

Reimplemented from Filesystem.

Definition at line 32 of file SysFs.h.

Member Data Documentation

◆ m_NextInode

Atomic<uintptr_t> SysFs::m_NextInode
private

Definition at line 63 of file SysFs.h.

◆ m_Root

SysFsDirectory* SysFs::m_Root
private

Definition at line 62 of file SysFs.h.


The documentation for this class was generated from the following files: