StuBS
Ramdisk Class Reference

#include <fs/ramdisk.h>

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

Public Member Functions

 Ramdisk (void *buf, size_t size)
 
Block fix (uint64_t block_number)
 
void unfix (Block *block)
 
int sync ()
 
int sync (Block *block)
 
- Public Member Functions inherited from BlockDevice
 BlockDevice ()
 
bool set_blocksize (unsigned int blocksize)
 
template<typename T >
divide_by_blocksize (T val) const
 
template<typename T >
modulo_blocksize (T val) const
 

Private Attributes

char * buf
 
size_t size
 

Additional Inherited Members

- Public Attributes inherited from BlockDevice
unsigned int blocksize
 
unsigned int blocksize_bits
 

Constructor & Destructor Documentation

◆ Ramdisk()

Ramdisk::Ramdisk ( void *  buf,
size_t  size 
)
inline

Member Function Documentation

◆ fix()

Block Ramdisk::fix ( uint64_t  block_number)
virtual

Implements BlockDevice.

◆ unfix()

void Ramdisk::unfix ( Block block)
virtual

Implements BlockDevice.

◆ sync() [1/2]

int Ramdisk::sync ( )
virtual

Implements BlockDevice.

◆ sync() [2/2]

int Ramdisk::sync ( Block block)
virtual

Implements BlockDevice.

Member Data Documentation

◆ buf

char* Ramdisk::buf
private

◆ size

size_t Ramdisk::size
private

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