ramdisk's header file
More...
#include <stdint.h>
#include <stdlib.h>
#include <glib.h>
#include <sys/time.h>
#include "device.h"
Go to the source code of this file.
ramdisk's header file
- Author
- Gijun Oh
- Version
- 0.2
- Date
- 2021-10-03
◆ ramdisk_close()
int ramdisk_close |
( |
struct device * |
dev | ) |
|
close the ramdisk
- Parameters
-
dev | pointer 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
-
dev | pointer of the device structure |
- Returns
- 0 for success, negative value for fail
◆ ramdisk_device_init()
int ramdisk_device_init |
( |
struct device * |
dev, |
|
|
uint64_t |
flags |
|
) |
| |
initialize the device and ramdisk module
- Parameters
-
dev | pointer of the device structure |
flags | flags for ramdisk and device |
- Returns
- 0 for sucess, negative value for fail
◆ ramdisk_erase()
erase a segment
- Parameters
-
dev | pointer of the device structure |
request | pointer of the device request structure |
- Returns
- 0 for success, negative value for fail
◆ ramdisk_open()
int ramdisk_open |
( |
struct device * |
dev, |
|
|
const char * |
name, |
|
|
int |
flags |
|
) |
| |
open the ramdisk (allocate the device resources)
- Parameters
-
dev | pointer of the device structure |
name | this does not use in this module |
flags | open flags for ramdisk |
- Returns
- 0 for success, negative value to fail
< This for make 4GiB disk
◆ ramdisk_read()
read from the ramdisk
- Parameters
-
dev | pointer of the device structure |
request | pointer of the device request structure |
- Returns
- read size (bytes)
◆ ramdisk_write()
write to the ramdisk
- Parameters
-
dev | pointer of the device structure |
request | pointer of the device request structure |
- Returns
- written size (bytes)