The Pedigree Project 0.1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
DevFs Class Reference

#include <DevFs.h>

+ Inheritance diagram for DevFs:
+ Collaboration diagram for DevFs:

Public Member Functions

SyncStatus sync () override
 
virtual bool initialise (Disk *pDisk)
 
virtual File * getRoot () const
 
virtual const String & getVolumeLabel () const
 
virtual size_t getNextInode ()
 
virtual void revertInode ()
 
bool isControllingTerminalSelector (const File *file) const
 
void handleInput (InputManager::InputNotification &in)
 
VirtualTerminalManager & getTerminalManager ()
 
- 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 bool deviceRemoved (bool deviceAvailable=false)
 
bool tryAcquireOperation (OperationBarrier::Lease &operation) const
 
bool isDeviceRemoved () const
 
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

virtual bool createFile (File *parent, const String &filename, uint32_t mask)
 
virtual bool createDirectory (File *parent, const String &filename, uint32_t mask)
 
virtual bool createSymlink (File *parent, const String &filename, const String &value)
 
virtual bool removeNode (File *, const String &, File *)
 
- 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)
 
bool beginDeviceRemoval (bool deviceAvailable)
 

Private Member Functions

 DevFs (const DevFs &)
 
DevFs & operator= (const DevFs &)
 

Private Attributes

DevFsDirectory * m_pRoot
 
File * m_CttySelector
 
SerialFile * m_Serial
 
size_t m_NextInode
 
VirtualTerminalManager * m_VtManager
 
PsAuxFile * m_pPsAuxFile
 

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
 
OperationBarrier m_Operations
 

Detailed Description

This class provides /dev

Definition at line 269 of file DevFs.h.

Constructor & Destructor Documentation

◆ DevFs()

DevFs::DevFs ( )
inline

Definition at line 275 of file DevFs.h.

◆ ~DevFs()

DevFs::~DevFs ( )
virtual

Definition at line 803 of file DevFs.cc.

Member Function Documentation

◆ createDirectory()

virtual bool DevFs::createDirectory ( File *  parent,
const String &  filename,
uint32_t  mask 
)
inlineprotectedvirtual

createDirectory calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 307 of file DevFs.h.

◆ createFile()

virtual bool DevFs::createFile ( File *  parent,
const String &  filename,
uint32_t  mask 
)
inlineprotectedvirtual

createFile calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 304 of file DevFs.h.

◆ createSymlink()

virtual bool DevFs::createSymlink ( File *  parent,
const String &  filename,
const String &  value 
)
inlineprotectedvirtual

createSymlink calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 310 of file DevFs.h.

◆ getNextInode()

size_t DevFs::getNextInode ( )
virtual

Definition at line 1000 of file DevFs.cc.

◆ getRoot()

virtual File * DevFs::getRoot ( ) const
inlinevirtual

Returns the root filesystem node.

Implements Filesystem.

Definition at line 282 of file DevFs.h.

◆ getTerminalManager()

VirtualTerminalManager & DevFs::getTerminalManager ( )
inline

Definition at line 299 of file DevFs.h.

◆ getVolumeLabel()

virtual const String & DevFs::getVolumeLabel ( ) const
inlinevirtual

Returns a string identifying the volume label.

Implements Filesystem.

Definition at line 285 of file DevFs.h.

◆ handleInput()

void DevFs::handleInput ( InputManager::InputNotification &  in)

Definition at line 1008 of file DevFs.cc.

◆ initialise()

bool DevFs::initialise ( Disk *  pDisk)
virtual

Populates this filesystem with data from the given Disk device.

Returns
true on success, false on failure.

Implements Filesystem.

Definition at line 814 of file DevFs.cc.

References EMIT_IF, File::getName(), InputManager::installCallback(), VFS::instance(), InputManager::instance(), InputManager::Key, and VFS::trackFile().

◆ isControllingTerminalSelector()

bool DevFs::isControllingTerminalSelector ( const File *  file) const
inline

Definition at line 293 of file DevFs.h.

◆ removeNode()

virtual bool DevFs::removeNode ( File *  parent,
const String &  filename,
File *  file 
)
inlineprotectedvirtual

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 313 of file DevFs.h.

◆ revertInode()

void DevFs::revertInode ( )
virtual

Definition at line 1004 of file DevFs.cc.

◆ sync()

SyncStatus DevFs::sync ( )
inlineoverridevirtual

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

Reimplemented from Filesystem.

Definition at line 271 of file DevFs.h.

Member Data Documentation

◆ m_CttySelector

File* DevFs::m_CttySelector
private

Definition at line 322 of file DevFs.h.

◆ m_NextInode

size_t DevFs::m_NextInode
private

Definition at line 325 of file DevFs.h.

◆ m_pPsAuxFile

PsAuxFile* DevFs::m_pPsAuxFile
private

Definition at line 329 of file DevFs.h.

◆ m_pRoot

DevFsDirectory* DevFs::m_pRoot
private

Definition at line 321 of file DevFs.h.

◆ m_Serial

SerialFile* DevFs::m_Serial
private

Definition at line 323 of file DevFs.h.

◆ m_VtManager

VirtualTerminalManager* DevFs::m_VtManager
private

Definition at line 327 of file DevFs.h.


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