StuBS
Filesystem Class Referenceabstract

#include <fs/filesystem.h>

Inheritance diagram for Filesystem:
[legend]
Collaboration diagram for Filesystem:
[legend]

Public Member Functions

 Filesystem ()
 
virtual ~Filesystem ()
 
virtual int mount (const void *data)=0
 
virtual int open (File *file)=0
 
virtual int close (File *file)=0
 
virtual uint64_t get_block (Inode *inode, uint64_t logical_block, bool create, int *error)=0
 
virtual ssize_t read (Inode *inode, void *buf, size_t count, off_t pos)
 
virtual ssize_t write (Inode *inode, const void *buf, size_t count, off_t pos)
 
virtual int punch_hole (Inode *inode, off_t from, off_t to)
 
virtual const char * get_link (Inode *inode, void(**cleanup_callback)(const char *buf), int *error)
 
virtual void truncate (Inode *inode, off_t length)=0
 
virtual int iterate_dir (Inode *directory, Dir_Context *ctx)=0
 
virtual Inodecreate (Inode *directory, const char *filename, size_t name_len, umode_t mode, int *error)=0
 
virtual int link (Inode *directory, const char *filename, size_t name_len, Inode *inode)=0
 
virtual int symlink (Inode *directory, const char *filename, size_t name_len, const char *symname)=0
 
virtual int unlink (Inode *directory, const char *filename, size_t name_len, Inode *inode)=0
 
virtual Inodelookup (Inode *directory, const char *filename, size_t name_len, int *error)=0
 
virtual int mkdir (Inode *parent_dir, const char *filename, size_t name_len, umode_t mode)=0
 
virtual int rmdir (Inode *parent_dir, const char *filename, size_t name_len, Inode *dir)=0
 
virtual int rename (Inode *old_dir, Inode *old_inode, const char *old_name, size_t old_name_len, Inode *new_dir, Inode *new_inode, const char *new_name, size_t new_name_len)=0
 
virtual Inodeallocate_inode ()=0
 
virtual int write_inode (Inode *inode)=0
 
virtual int sync ()=0
 
virtual void umount ()=0
 

Public Attributes

BlockDevicebdev
 
Inoderoot_inode
 
unsigned long num_inode_references
 

Constructor & Destructor Documentation

◆ Filesystem()

Filesystem::Filesystem ( )
inline

◆ ~Filesystem()

virtual Filesystem::~Filesystem ( )
inlinevirtual

Member Function Documentation

◆ mount()

virtual int Filesystem::mount ( const void *  data)
pure virtual

Implemented in Minix.

◆ open()

virtual int Filesystem::open ( File file)
pure virtual

Implemented in Minix.

◆ close()

virtual int Filesystem::close ( File file)
pure virtual

Implemented in Minix.

◆ get_block()

virtual uint64_t Filesystem::get_block ( Inode inode,
uint64_t  logical_block,
bool  create,
int *  error 
)
pure virtual

Implemented in Minix.

◆ read()

ssize_t Filesystem::read ( Inode inode,
void *  buf,
size_t  count,
off_t  pos 
)
virtual

◆ write()

ssize_t Filesystem::write ( Inode inode,
const void *  buf,
size_t  count,
off_t  pos 
)
virtual

◆ punch_hole()

int Filesystem::punch_hole ( Inode inode,
off_t  from,
off_t  to 
)
virtual

◆ get_link()

const char * Filesystem::get_link ( Inode inode,
void(**)(const char *buf)  cleanup_callback,
int *  error 
)
virtual

◆ truncate()

virtual void Filesystem::truncate ( Inode inode,
off_t  length 
)
pure virtual

Implemented in Minix.

◆ iterate_dir()

virtual int Filesystem::iterate_dir ( Inode directory,
Dir_Context ctx 
)
pure virtual

Implemented in Minix.

◆ create()

virtual Inode * Filesystem::create ( Inode directory,
const char *  filename,
size_t  name_len,
umode_t  mode,
int *  error 
)
pure virtual

Implemented in Minix.

◆ link()

virtual int Filesystem::link ( Inode directory,
const char *  filename,
size_t  name_len,
Inode inode 
)
pure virtual

Implemented in Minix.

◆ symlink()

virtual int Filesystem::symlink ( Inode directory,
const char *  filename,
size_t  name_len,
const char *  symname 
)
pure virtual

Implemented in Minix.

◆ unlink()

virtual int Filesystem::unlink ( Inode directory,
const char *  filename,
size_t  name_len,
Inode inode 
)
pure virtual

Implemented in Minix.

◆ lookup()

virtual Inode * Filesystem::lookup ( Inode directory,
const char *  filename,
size_t  name_len,
int *  error 
)
pure virtual

Implemented in Minix.

◆ mkdir()

virtual int Filesystem::mkdir ( Inode parent_dir,
const char *  filename,
size_t  name_len,
umode_t  mode 
)
pure virtual

Implemented in Minix.

◆ rmdir()

virtual int Filesystem::rmdir ( Inode parent_dir,
const char *  filename,
size_t  name_len,
Inode dir 
)
pure virtual

Implemented in Minix.

◆ rename()

virtual int Filesystem::rename ( Inode old_dir,
Inode old_inode,
const char *  old_name,
size_t  old_name_len,
Inode new_dir,
Inode new_inode,
const char *  new_name,
size_t  new_name_len 
)
pure virtual

Implemented in Minix.

◆ allocate_inode()

virtual Inode * Filesystem::allocate_inode ( )
pure virtual

Implemented in Minix.

◆ write_inode()

virtual int Filesystem::write_inode ( Inode inode)
pure virtual

Implemented in Minix.

◆ sync()

virtual int Filesystem::sync ( )
pure virtual

Implemented in Minix.

◆ umount()

virtual void Filesystem::umount ( )
pure virtual

Implemented in Minix.

Member Data Documentation

◆ bdev

BlockDevice* Filesystem::bdev

◆ root_inode

Inode* Filesystem::root_inode

◆ num_inode_references

unsigned long Filesystem::num_inode_references

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