sofs19  0.1
FUSE based file system
rawdisk

Access to disk blocks at raw level. More...

Functions

void soOpenRawDisk (const char *devname, uint32_t *np=NULL)
 Open the storage device. More...
 
void soCloseRawDisk (void)
 Close the storage device. More...
 
void soReadRawBlock (uint32_t n, void *buf)
 Read a block of data from the storage device. More...
 
void soWriteRawBlock (uint32_t n, void *buf)
 Write a block of data from the storage device. More...
 

Detailed Description

Access to disk blocks at raw level.

Remarks
In case an error occurs, every function throws an error code (an int)

Function Documentation

◆ soOpenRawDisk()

void sofs19::soOpenRawDisk ( const char *  devname,
uint32_t *  np = NULL 
)

Open the storage device.

A communication channel is established with the storage device. It is supposed that no communication channel was previously established. The storage file must exist and have a size multiple of the block size.

Parameters
[in]devnameabsolute path to the Linux file that simulates the storage device
[out]npif not null, pointer to a location where the number of blocks of the device is to be stored

◆ soCloseRawDisk()

void sofs19::soCloseRawDisk ( void  )

Close the storage device.

The communication channel previously established with the storage device is closed.

◆ soReadRawBlock()

void sofs19::soReadRawBlock ( uint32_t  n,
void *  buf 
)

Read a block of data from the storage device.

Parameters
[in]nphysical number of the data block to be read from
[out]bufpointer to the buffer where the data must be read into

◆ soWriteRawBlock()

void sofs19::soWriteRawBlock ( uint32_t  n,
void *  buf 
)

Write a block of data from the storage device.

Parameters
[in]nphysical number of the block to be written into
[in]bufpointer to the buffer containing the data to be written from