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

#include <Iso9660Filesystem.h>

+ Inheritance diagram for Iso9660Filesystem:
+ Collaboration diagram for Iso9660Filesystem:

Public Member Functions

virtual bool initialise (Disk *pDisk)
 
virtual File * getRoot () const
 
virtual const String & getVolumeLabel () const
 
- 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 sync ()
 
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 Filesystem * probe (Disk *pDisk)
 

Protected Member Functions

uintptr_t readBlock (File *pFile, uint64_t location)
 
size_t getBlockSize ()
 
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 Disk * getDisk ()
 
String parseName (Iso9660DirRecord &name)
 
String parseJolietName (Iso9660DirRecord &name)
 
bool readSector (uint64_t location, void *destination)
 
bool isLeap (uint32_t year)
 
Time::Timestamp timeToUnix (Iso9660DirTimestamp &time)
 
File * fileFromDirRecord (Iso9660DirRecord &dir, size_t inodeNum, File *parent, bool bDirectory=false)
 
 Iso9660Filesystem (const Iso9660Filesystem &)
 
void operator= (const Iso9660Filesystem &)
 
- 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)
 

Protected Attributes

Disk * m_pDisk
 
Iso9660VolumeDescriptorPrimary m_PrimaryVolDesc
 
Iso9660VolumeDescriptorPrimary m_SuppVolDesc
 
Iso9660VolumeDescriptor m_VolDesc
 
Iso9660DirRecord * m_RootDir
 
int m_JolietLevel
 
size_t m_BlockSize
 
size_t m_BlockNumber
 
String m_VolumeLabel
 
File * m_pRoot
 
- Protected Attributes inherited from Filesystem
bool m_bReadOnly
 
Disk * m_pDisk
 
DiskUse m_DiskUse
 
OperationBarrier m_Operations
 

Friends

class Iso9660File
 
class Iso9660Directory
 

Additional Inherited Members

- Public Types inherited from Filesystem
enum class  SyncStatus { Success , Unsupported , NoMemory , IoError }
 
typedef Filesystem *(* ProbeCallback) (Disk *)
 

Detailed Description

This class provides an implementation of the ISO9660 filesystem.

Definition at line 34 of file Iso9660Filesystem.h.

Constructor & Destructor Documentation

◆ Iso9660Filesystem()

Iso9660Filesystem::Iso9660Filesystem ( )

Definition at line 61 of file Iso9660Filesystem.cc.

◆ ~Iso9660Filesystem()

Iso9660Filesystem::~Iso9660Filesystem ( )
virtual

Definition at line 73 of file Iso9660Filesystem.cc.

Member Function Documentation

◆ createDirectory()

bool Iso9660Filesystem::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 243 of file Iso9660Filesystem.cc.

◆ createFile()

bool Iso9660Filesystem::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 239 of file Iso9660Filesystem.cc.

◆ createSymlink()

bool Iso9660Filesystem::createSymlink ( File *  parent,
const String &  filename,
const String &  value 
)
protectedvirtual

createSymlink calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 247 of file Iso9660Filesystem.cc.

◆ fileFromDirRecord()

File * Iso9660Filesystem::fileFromDirRecord ( Iso9660DirRecord &  dir,
size_t  inodeNum,
File *  parent,
bool  bDirectory = false 
)
protected

Definition at line 297 of file Iso9660Filesystem.cc.

◆ getBlockSize()

size_t Iso9660Filesystem::getBlockSize ( )
inlineprotected

Definition at line 54 of file Iso9660Filesystem.h.

◆ getDisk()

virtual Disk * Iso9660Filesystem::getDisk ( )
inlineprotectedvirtual

Definition at line 63 of file Iso9660Filesystem.h.

◆ getRoot()

File * Iso9660Filesystem::getRoot ( ) const
virtual

Returns the root filesystem node.

Implements Filesystem.

Definition at line 188 of file Iso9660Filesystem.cc.

References m_pRoot.

◆ getVolumeLabel()

const String & Iso9660Filesystem::getVolumeLabel ( ) const
virtual

Returns a string identifying the volume label.

Implements Filesystem.

Definition at line 192 of file Iso9660Filesystem.cc.

References m_VolumeLabel.

◆ initialise()

bool Iso9660Filesystem::initialise ( Disk *  pDisk)
virtual

Populates this filesystem with data from the given Disk device.

Returns
true on success, false on failure.
Todo:
Obtain disk information (perhaps a new call in Disk?)

Implements Filesystem.

Definition at line 75 of file Iso9660Filesystem.cc.

References m_BlockSize, Filesystem::m_bReadOnly, m_JolietLevel, m_pDisk, m_PrimaryVolDesc, m_pRoot, m_VolumeLabel, and readSector().

◆ isLeap()

bool Iso9660Filesystem::isLeap ( uint32_t  year)
inlineprotected

Definition at line 73 of file Iso9660Filesystem.h.

◆ parseJolietName()

String Iso9660Filesystem::parseJolietName ( Iso9660DirRecord &  name)
protected

Definition at line 280 of file Iso9660Filesystem.cc.

◆ parseName()

String Iso9660Filesystem::parseName ( Iso9660DirRecord &  name)
protected

Definition at line 255 of file Iso9660Filesystem.cc.

◆ probe()

Filesystem * Iso9660Filesystem::probe ( Disk *  pDisk)
static

Definition at line 178 of file Iso9660Filesystem.cc.

◆ readBlock()

uintptr_t Iso9660Filesystem::readBlock ( File *  pFile,
uint64_t  location 
)
protected

Definition at line 212 of file Iso9660Filesystem.cc.

◆ readSector()

bool Iso9660Filesystem::readSector ( uint64_t  location,
void *  destination 
)
protected

Copies one logical ISO sector from one or more target-page views.

Definition at line 196 of file Iso9660Filesystem.cc.

References m_pDisk, Disk::readViews(), and Disk::unpinViews().

Referenced by initialise().

+ Here is the caller graph for this function:

◆ removeNode()

bool Iso9660Filesystem::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 251 of file Iso9660Filesystem.cc.

◆ timeToUnix()

Time::Timestamp Iso9660Filesystem::timeToUnix ( Iso9660DirTimestamp &  time)
inlineprotected

Definition at line 84 of file Iso9660Filesystem.h.

Friends And Related Symbol Documentation

◆ Iso9660Directory

friend class Iso9660Directory
friend

Definition at line 36 of file Iso9660Filesystem.h.

◆ Iso9660File

friend class Iso9660File
friend

Definition at line 35 of file Iso9660Filesystem.h.

Member Data Documentation

◆ m_BlockNumber

size_t Iso9660Filesystem::m_BlockNumber
protected

Definition at line 130 of file Iso9660Filesystem.h.

◆ m_BlockSize

size_t Iso9660Filesystem::m_BlockSize
protected

Block size, and block number, of the disk

Definition at line 129 of file Iso9660Filesystem.h.

Referenced by initialise().

◆ m_JolietLevel

int Iso9660Filesystem::m_JolietLevel
protected

Joliet level (0 if not using it)

Definition at line 126 of file Iso9660Filesystem.h.

Referenced by initialise().

◆ m_pDisk

Disk* Iso9660Filesystem::m_pDisk
protected

◆ m_PrimaryVolDesc

Iso9660VolumeDescriptorPrimary Iso9660Filesystem::m_PrimaryVolDesc
protected

Our superblock

Definition at line 120 of file Iso9660Filesystem.h.

Referenced by initialise().

◆ m_pRoot

File* Iso9660Filesystem::m_pRoot
protected

Root filesystem node.

Definition at line 136 of file Iso9660Filesystem.h.

Referenced by getRoot(), and initialise().

◆ m_RootDir

Iso9660DirRecord* Iso9660Filesystem::m_RootDir
protected

Definition at line 123 of file Iso9660Filesystem.h.

◆ m_SuppVolDesc

Iso9660VolumeDescriptorPrimary Iso9660Filesystem::m_SuppVolDesc
protected

Definition at line 121 of file Iso9660Filesystem.h.

◆ m_VolDesc

Iso9660VolumeDescriptor Iso9660Filesystem::m_VolDesc
protected

Definition at line 122 of file Iso9660Filesystem.h.

◆ m_VolumeLabel

String Iso9660Filesystem::m_VolumeLabel
protected

Our volume label

Definition at line 133 of file Iso9660Filesystem.h.

Referenced by getVolumeLabel(), and initialise().


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