Flash Translation Layer
1.0
|
implementation of the bluedbm abstraction layer which is inherited by the device More...
#include <stdlib.h>
#include <errno.h>
#include <libmemio.h>
#include <pthread.h>
#include <fcntl.h>
#include <unistd.h>
#include <assert.h>
#include <string.h>
#include "include/bluedbm.h"
#include "include/device.h"
#include "include/log.h"
#include "include/bits.h"
Functions | |
static void | bluedbm_erase_end_request (uint64_t segnum, uint8_t is_bad) |
end request for the erase More... | |
static int | bluedbm_clear (struct device *dev) |
clear all segments in the flash board More... | |
static void | bluedbm_wait_erase_finish (struct device *dev, size_t segnum, size_t nr_segments) |
wait the erase is finished More... | |
int | bluedbm_open (struct device *dev, const char *name, int flags) |
open the bluedbm based device More... | |
static void | bluedbm_end_rw_request (async_bdbm_req *rw_req) |
end request for the read/write More... | |
ssize_t | bluedbm_write (struct device *dev, struct device_request *request) |
write to the flash board More... | |
ssize_t | bluedbm_read (struct device *dev, struct device_request *request) |
read from the flash board More... | |
int | bluedbm_erase (struct device *dev, struct device_request *request) |
erase a segment More... | |
int | bluedbm_close (struct device *dev) |
close the bluedbm More... | |
int | bluedbm_device_init (struct device *dev, uint64_t flags) |
initialize the device and bluedbm module More... | |
int | bluedbm_device_exit (struct device *dev) |
deallocate the device module More... | |
Variables | |
gint * | g_badseg_counter = NULL |
gint * | g_erase_counter = NULL |
const struct device_operations | __bluedbm_dops |
bluedbm module operations More... | |
implementation of the bluedbm abstraction layer which is inherited by the device
|
static |
clear all segments in the flash board
dev | pointer of the device structure |
int bluedbm_close | ( | struct device * | dev | ) |
close the bluedbm
dev | pointer of the device structure |
int bluedbm_device_exit | ( | struct device * | dev | ) |
deallocate the device module
dev | pointer of the device structure |
int bluedbm_device_init | ( | struct device * | dev, |
uint64_t | flags | ||
) |
initialize the device and bluedbm module
dev | pointer of the device structure |
flags | flags for bluedbm and device |
|
static |
end request for the read/write
rw_req | read/write request pointer |
int bluedbm_erase | ( | struct device * | dev, |
struct device_request * | request | ||
) |
erase a segment
dev | pointer of the device structure |
request | pointer of the device request structure |
|
static |
end request for the erase
segnum | erased segment number |
is_bad | erased segment is bad segment or not |
int bluedbm_open | ( | struct device * | dev, |
const char * | name, | ||
int | flags | ||
) |
open the bluedbm based device
dev | pointer of the device structure |
name | this does not use in this module |
flags | open flags for this module |
ssize_t bluedbm_read | ( | struct device * | dev, |
struct device_request * | request | ||
) |
read from the flash board
dev | pointer of the device structure |
request | pointer of the device request structure |
|
static |
wait the erase is finished
dev | pointer of the device structure |
segnum | initial position to erase target segment |
nr_segments | number of segments to erase |
ssize_t bluedbm_write | ( | struct device * | dev, |
struct device_request * | request | ||
) |
write to the flash board
dev | pointer of the device structure |
request | pointer of the device request structure |
const struct device_operations __bluedbm_dops |
bluedbm module operations
gint* g_badseg_counter = NULL |
counter for bad segemnt detection
gint* g_erase_counter = NULL |
counter for # of erase in the segment