Flash Translation Layer  1.0
Data Structures | Functions
ramdisk.h File Reference

ramdisk's header file More...

#include <stdint.h>
#include <stdlib.h>
#include <glib.h>
#include <sys/time.h>
#include "device.h"
Include dependency graph for ramdisk.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ramdisk
 structure for manage the ramdisk More...
 

Functions

int ramdisk_open (struct device *, const char *name, int flags)
 open the ramdisk (allocate the device resources) More...
 
ssize_t ramdisk_write (struct device *, struct device_request *)
 write to the ramdisk More...
 
ssize_t ramdisk_read (struct device *, struct device_request *)
 read from the ramdisk More...
 
int ramdisk_erase (struct device *, struct device_request *)
 erase a segment More...
 
int ramdisk_close (struct device *)
 close the ramdisk More...
 
int ramdisk_device_init (struct device *, uint64_t flags)
 initialize the device and ramdisk module More...
 
int ramdisk_device_exit (struct device *)
 deallocate the device module More...
 

Detailed Description

ramdisk's header file

Author
Gijun Oh
Version
0.2
Date
2021-10-03

Function Documentation

◆ ramdisk_close()

int ramdisk_close ( struct device dev)

close the ramdisk

Parameters
devpointer of the device structure
Returns
0 for success, negative value for fail

◆ ramdisk_device_exit()

int ramdisk_device_exit ( struct device dev)

deallocate the device module

Parameters
devpointer of the device structure
Returns
0 for success, negative value for fail
Here is the call graph for this function:

◆ ramdisk_device_init()

int ramdisk_device_init ( struct device dev,
uint64_t  flags 
)

initialize the device and ramdisk module

Parameters
devpointer of the device structure
flagsflags for ramdisk and device
Returns
0 for sucess, negative value for fail
Here is the call graph for this function:

◆ ramdisk_erase()

int ramdisk_erase ( struct device dev,
struct device_request request 
)

erase a segment

Parameters
devpointer of the device structure
requestpointer of the device request structure
Returns
0 for success, negative value for fail
Here is the call graph for this function:

◆ ramdisk_open()

int ramdisk_open ( struct device dev,
const char *  name,
int  flags 
)

open the ramdisk (allocate the device resources)

Parameters
devpointer of the device structure
namethis does not use in this module
flagsopen flags for ramdisk
Returns
0 for success, negative value to fail

< This for make 4GiB disk

Here is the call graph for this function:

◆ ramdisk_read()

ssize_t ramdisk_read ( struct device dev,
struct device_request request 
)

read from the ramdisk

Parameters
devpointer of the device structure
requestpointer of the device request structure
Returns
read size (bytes)
Here is the call graph for this function:

◆ ramdisk_write()

ssize_t ramdisk_write ( struct device dev,
struct device_request request 
)

write to the ramdisk

Parameters
devpointer of the device structure
requestpointer of the device request structure
Returns
written size (bytes)
Here is the call graph for this function: