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

#include <ProcFs.h>

+ Inheritance diagram for ProcFs:
+ Collaboration diagram for ProcFs:

Public Member Functions

virtual bool initialise (Disk *pDisk)
 
virtual FilegetRoot () const
 
virtual String getVolumeLabel () const
 
virtual size_t getNextInode ()
 
virtual void revertInode ()
 
void addProcess (PosixProcess *proc)
 
void removeProcess (PosixProcess *proc)
 
- Public Member Functions inherited from Filesystem
 Filesystem ()
 
virtual ~Filesystem ()
 
virtual Filefind (const StringView &path)
 
virtual Filefind (const String &path)
 
virtual Filefind (const StringView &path, File *pStartNode)
 
virtual Filefind (const String &path, File *pStartNode)
 
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)
 
DiskgetDisk ()
 
bool isReadOnly ()
 
virtual bool isCaseSensitive ()
 

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

Private Member Functions

 ProcFs (const ProcFs &)
 
ProcFsoperator= (const ProcFs &)
 

Private Attributes

ProcFsDirectorym_pRoot
 
Tree< size_t, ProcFsDirectory * > m_pProcessDirectories
 
size_t m_NextInode
 
String m_PciDevices
 

Additional Inherited Members

- Public Types inherited from Filesystem
typedef Filesystem *(* ProbeCallback) (Disk *)
 
- Protected Attributes inherited from Filesystem
bool m_bReadOnly
 
Diskm_pDisk
 

Detailed Description

This class provides /dev

Definition at line 192 of file ProcFs.h.

Member Function Documentation

void ProcFs::addProcess ( PosixProcess proc)
Todo:
is this correct? or should it be effective user/group?
Todo:
add some info to the directory...

Definition at line 555 of file ProcFs.cc.

References Process::getGroup(), Group::getId(), User::getId(), Process::getId(), and Process::getUser().

Referenced by PosixProcess::getType().

+ Here is the caller graph for this function:

virtual bool ProcFs::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 224 of file ProcFs.h.

virtual bool ProcFs::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 219 of file ProcFs.h.

virtual bool ProcFs::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 229 of file ProcFs.h.

virtual File* ProcFs::getRoot ( ) const
inlinevirtual

Returns the root filesystem node.

Implements Filesystem.

Definition at line 203 of file ProcFs.h.

virtual String ProcFs::getVolumeLabel ( ) const
inlinevirtual

Returns a string identifying the volume label.

Implements Filesystem.

Definition at line 207 of file ProcFs.h.

bool ProcFs::initialise ( Disk pDisk)
virtual

Populates this filesystem with data from the given Disk device.

Returns
true on success, false on failure.
Todo:
need to know parent (if any) so we can add dotdot too
Todo:
also probably need /etc/mtab...
Todo:
need to add some flags here
Todo:
add driver name here if known?

Implements Filesystem.

Definition at line 379 of file ProcFs.cc.

References VFS::find(), Device::foreach(), Directory::fromFile(), File::getName(), VFS::instance(), String::m_Size, and NOTICE.

virtual bool ProcFs::remove ( File parent,
File file 
)
inlineprotectedvirtual

Remove a file given a parent and file, assuming path parsing already completed.

Implements Filesystem.

Definition at line 233 of file ProcFs.h.

void ProcFs::removeProcess ( PosixProcess proc)
Todo:
should also remove all the files/directories in the directory
Bug:
leaks all files/directories in the directory

Definition at line 582 of file ProcFs.cc.

References Process::getId().

Referenced by PosixProcess::getType().

+ Here is the caller graph for this function:


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