StuBS
Minix Class Reference

#include <fs/minix/minix.h>

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

Public Member Functions

 Minix ()
 
 ~Minix ()
 
int mount (const void *data)
 
int sync ()
 
void umount ()
 
int open (File *file)
 
int close (File *file)
 
uint64_t get_block (Inode *inode, uint64_t logical_block, bool create, int *error)
 
Inodecreate (Inode *dir, const char *filename, size_t name_len, umode_t mode, int *error)
 
int link (Inode *dir, const char *filename, size_t name_len, Inode *inode)
 
int symlink (Inode *dir, const char *filename, size_t name_len, const char *symname)
 
int unlink (Inode *dir, const char *filename, size_t name_len, Inode *inode)
 
void truncate (Inode *inode, off_t length)
 
Inodelookup (Inode *dir, const char *filename, size_t name_len, int *error)
 
int iterate_dir (Inode *dir, Dir_Context *ctx)
 
int mkdir (Inode *parent_dir, const char *filename, size_t name_len, umode_t mode)
 
int rmdir (Inode *parent_dir, const char *filename, size_t name_len, Inode *dir)
 
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)
 
int write_inode (Inode *inode)
 
Inodeallocate_inode ()
 
- Public Member Functions inherited from Filesystem
 Filesystem ()
 
virtual ~Filesystem ()
 
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)
 

Private Member Functions

Inodeiget (unsigned long ino, int *error)
 
int new_block ()
 
Minix_Disk_Inoderaw_inode (ino_t ino, Block *block, int *error)
 
Inodenew_inode (umode_t mode, int *error)
 
int block_to_path (unsigned long block, int offsets[DEPTH])
 
Indirectget_branch (Inode *inode, int depth, int *offsets, Indirect chain[DEPTH], int *err)
 
int alloc_branch (int num, int *offsets, Indirect *branch)
 
Minix_Direntfind_dirent (Inode *dir, const char *filename, size_t name_len, Block *p_block, int *error)
 
int add_link (Inode *dir, Inode *inode, const char *name, size_t name_len)
 
int delete_entry (Inode *dir, const char *filename, size_t name_len)
 
int make_empty_dir (Inode *inode, Inode *parent_dir)
 
void free_branches (Inode *inode, block_t *p, block_t *q, int depth)
 
Indirectfind_shared (Inode *inode, int depth, int offsets[DEPTH], Indirect chain[DEPTH], block_t *top)
 
void free_data (block_t *p, const block_t *q)
 
void free_block (unsigned long block)
 
void clear_disk_inode (Inode *inode)
 
void free_inode (Inode *inode)
 
int check_dir_is_empty (Inode *dir)
 
unsigned int dir_block_last_byte (Inode *dir, unsigned long lblock)
 

Private Attributes

friend MinixInode
 
Minix_Super_Blocksuper
 
Block super_block
 
Blockimap
 
Blockzmap
 

Additional Inherited Members

- Public Attributes inherited from Filesystem
BlockDevicebdev
 
Inoderoot_inode
 
unsigned long num_inode_references
 

Constructor & Destructor Documentation

◆ Minix()

Minix::Minix ( )
inline

◆ ~Minix()

Minix::~Minix ( )
inline

Member Function Documentation

◆ mount()

int Minix::mount ( const void *  data)
virtual

Implements Filesystem.

◆ sync()

int Minix::sync ( )
virtual

Implements Filesystem.

◆ umount()

void Minix::umount ( )
virtual

Implements Filesystem.

◆ open()

int Minix::open ( File file)
virtual

Implements Filesystem.

◆ close()

int Minix::close ( File file)
virtual

Implements Filesystem.

◆ get_block()

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

Implements Filesystem.

◆ create()

Inode * Minix::create ( Inode dir,
const char *  filename,
size_t  name_len,
umode_t  mode,
int *  error 
)
virtual

Implements Filesystem.

◆ link()

int Minix::link ( Inode dir,
const char *  filename,
size_t  name_len,
Inode inode 
)
virtual

Implements Filesystem.

◆ symlink()

int Minix::symlink ( Inode dir,
const char *  filename,
size_t  name_len,
const char *  symname 
)
virtual

Implements Filesystem.

◆ unlink()

int Minix::unlink ( Inode dir,
const char *  filename,
size_t  name_len,
Inode inode 
)
virtual

Implements Filesystem.

◆ truncate()

void Minix::truncate ( Inode inode,
off_t  length 
)
virtual

Implements Filesystem.

◆ lookup()

Inode * Minix::lookup ( Inode dir,
const char *  filename,
size_t  name_len,
int *  error 
)
virtual

Implements Filesystem.

◆ iterate_dir()

int Minix::iterate_dir ( Inode dir,
Dir_Context ctx 
)
virtual

Implements Filesystem.

◆ mkdir()

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

Implements Filesystem.

◆ rmdir()

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

Implements Filesystem.

◆ rename()

int Minix::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 
)
virtual

Implements Filesystem.

◆ write_inode()

int Minix::write_inode ( Inode inode)
virtual

Implements Filesystem.

◆ allocate_inode()

Inode * Minix::allocate_inode ( )
virtual

Implements Filesystem.

◆ iget()

Inode * Minix::iget ( unsigned long  ino,
int *  error 
)
private

◆ new_block()

int Minix::new_block ( )
private

◆ raw_inode()

Minix_Disk_Inode * Minix::raw_inode ( ino_t  ino,
Block block,
int *  error 
)
private

◆ new_inode()

Inode * Minix::new_inode ( umode_t  mode,
int *  error 
)
private

◆ block_to_path()

int Minix::block_to_path ( unsigned long  block,
int  offsets[DEPTH] 
)
private

◆ get_branch()

Indirect * Minix::get_branch ( Inode inode,
int  depth,
int *  offsets,
Indirect  chain[DEPTH],
int *  err 
)
inlineprivate

◆ alloc_branch()

int Minix::alloc_branch ( int  num,
int *  offsets,
Indirect branch 
)
private

◆ find_dirent()

Minix_Dirent * Minix::find_dirent ( Inode dir,
const char *  filename,
size_t  name_len,
Block p_block,
int *  error 
)
private

◆ add_link()

int Minix::add_link ( Inode dir,
Inode inode,
const char *  name,
size_t  name_len 
)
private

◆ delete_entry()

int Minix::delete_entry ( Inode dir,
const char *  filename,
size_t  name_len 
)
private

◆ make_empty_dir()

int Minix::make_empty_dir ( Inode inode,
Inode parent_dir 
)
private

◆ free_branches()

void Minix::free_branches ( Inode inode,
block_t p,
block_t q,
int  depth 
)
private

◆ find_shared()

Indirect * Minix::find_shared ( Inode inode,
int  depth,
int  offsets[DEPTH],
Indirect  chain[DEPTH],
block_t top 
)
private

◆ free_data()

void Minix::free_data ( block_t p,
const block_t q 
)
private

◆ free_block()

void Minix::free_block ( unsigned long  block)
private

◆ clear_disk_inode()

void Minix::clear_disk_inode ( Inode inode)
private

◆ free_inode()

void Minix::free_inode ( Inode inode)
private

◆ check_dir_is_empty()

int Minix::check_dir_is_empty ( Inode dir)
private

◆ dir_block_last_byte()

unsigned int Minix::dir_block_last_byte ( Inode dir,
unsigned long  lblock 
)
inlineprivate

Member Data Documentation

◆ MinixInode

friend Minix::MinixInode
private

◆ super

Minix_Super_Block* Minix::super
private

◆ super_block

Block Minix::super_block
private

◆ imap

Block* Minix::imap
private

◆ zmap

Block* Minix::zmap
private

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