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

#include <UnixFilesystem.h>

+ Inheritance diagram for UnixFilesystem:
+ Collaboration diagram for UnixFilesystem:

Public Member Functions

SyncStatus sync () override
 
virtual bool initialise (Disk *pDisk)
 
virtual File * getRoot () const
 
virtual const String & getVolumeLabel () const
 
virtual void truncate (File *pFile)
 
virtual void fileAttributeChanged (File *pFile)
 
virtual void cacheDirectoryContents (File *pFile)
 
virtual void extend (File *pFile, size_t size)
 
- 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)
 

Static Public Member Functions

static Mutex & namespaceLock ()
 

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 *parent, const String &filename, File *file)
 
virtual bool renameNode (Directory *, const String &, File *, Directory *, const String &, File *)
 
- Protected Member Functions inherited from Filesystem
virtual bool createLink (File *parent, const String &filename, File *target)
 
bool beginDeviceRemoval (bool deviceAvailable)
 

Private Member Functions

virtual bool isBytewise () const
 

Private Attributes

File * m_pRoot
 

Static Private Attributes

static String m_VolumeLabel
 
static Mutex m_NamespaceLock
 

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

UnixFilesystem: UNIX sockets.

This filesystem is mounted with the "unix" 'volume' label, and provides the filesystem abstraction for UNIX sockets (at least, non-anonymous ones).

Definition at line 200 of file UnixFilesystem.h.

Constructor & Destructor Documentation

◆ UnixFilesystem()

UnixFilesystem::UnixFilesystem ( )

Definition at line 1474 of file UnixFilesystem.cc.

◆ ~UnixFilesystem()

UnixFilesystem::~UnixFilesystem ( )
virtual

Definition at line 1485 of file UnixFilesystem.cc.

Member Function Documentation

◆ cacheDirectoryContents()

virtual void UnixFilesystem::cacheDirectoryContents ( File *  pFile)
inlinevirtual

Definition at line 229 of file UnixFilesystem.h.

◆ createDirectory()

bool UnixFilesystem::createDirectory ( File *  parent,
const String &  filename,
uint32_t  mask 
)
protectedvirtual

createDirectory calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 1512 of file UnixFilesystem.cc.

References Directory::fromFile().

◆ createFile()

bool UnixFilesystem::createFile ( File *  parent,
const String &  filename,
uint32_t  mask 
)
protectedvirtual

createFile calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 1496 of file UnixFilesystem.cc.

References Directory::fromFile().

◆ createSymlink()

virtual bool UnixFilesystem::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 241 of file UnixFilesystem.h.

◆ extend()

virtual void UnixFilesystem::extend ( File *  pFile,
size_t  size 
)
inlinevirtual

Definition at line 236 of file UnixFilesystem.h.

◆ fileAttributeChanged()

virtual void UnixFilesystem::fileAttributeChanged ( File *  pFile)
inlinevirtual

Definition at line 227 of file UnixFilesystem.h.

◆ getRoot()

virtual File * UnixFilesystem::getRoot ( ) const
inlinevirtual

Returns the root filesystem node.

Implements Filesystem.

Definition at line 213 of file UnixFilesystem.h.

◆ getVolumeLabel()

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

Returns a string identifying the volume label.

Implements Filesystem.

Definition at line 217 of file UnixFilesystem.h.

◆ initialise()

virtual bool UnixFilesystem::initialise ( Disk *  pDisk)
inlinevirtual

Populates this filesystem with data from the given Disk device.

Returns
true on success, false on failure.

Implements Filesystem.

Definition at line 209 of file UnixFilesystem.h.

◆ isBytewise()

virtual bool UnixFilesystem::isBytewise ( ) const
inlineprivatevirtual

Definition at line 255 of file UnixFilesystem.h.

◆ namespaceLock()

Mutex & UnixFilesystem::namespaceLock ( )
static

Definition at line 1492 of file UnixFilesystem.cc.

◆ removeNode()

bool UnixFilesystem::removeNode ( File *  parent,
const String &  filename,
File *  file 
)
protectedvirtual

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 1528 of file UnixFilesystem.cc.

References Directory::fromFile(), and File::isDirectory().

◆ renameNode()

virtual bool UnixFilesystem::renameNode ( Directory *  oldParent,
const String &  oldName,
File *  source,
Directory *  newParent,
const String &  newName,
File *  replaced 
)
inlineprotectedvirtual

Change backing entries while the VFS reserves both names and owns their namespace locks. Do not call ordinary lookup/add/remove APIs here. Failure must leave both names unchanged; the VFS publishes cache changes on success.

Reimplemented from Filesystem.

Definition at line 245 of file UnixFilesystem.h.

◆ sync()

SyncStatus UnixFilesystem::sync ( )
inlineoverridevirtual

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

Reimplemented from Filesystem.

Definition at line 202 of file UnixFilesystem.h.

◆ truncate()

virtual void UnixFilesystem::truncate ( File *  pFile)
inlinevirtual

Definition at line 225 of file UnixFilesystem.h.

Member Data Documentation

◆ m_NamespaceLock

Mutex UnixFilesystem::m_NamespaceLock
staticprivate

Definition at line 253 of file UnixFilesystem.h.

◆ m_pRoot

File* UnixFilesystem::m_pRoot
private

Definition at line 250 of file UnixFilesystem.h.

◆ m_VolumeLabel

String UnixFilesystem::m_VolumeLabel
staticprivate

Definition at line 252 of file UnixFilesystem.h.


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