Flash Translation Layer
1.0
|
declaration of data structures and macros for page ftl More...
#include <stdint.h>
#include <pthread.h>
#include <limits.h>
#include <unistd.h>
#include <glib.h>
#include "flash.h"
#include "device.h"
Go to the source code of this file.
Data Structures | |
struct | page_ftl_segment |
segment information structure More... | |
struct | page_ftl |
contain the page flash translation layer information More... | |
Macros | |
#define | PAGE_FTL_CACHE_SIZE (2) |
#define | PAGE_FTL_GC_RATIO |
#define | PAGE_FTL_GC_THRESHOLD |
Enumerations | |
enum | { PAGE_FTL_IOCTL_TRIM = 0 } |
Functions | |
int | page_ftl_open (struct page_ftl *, const char *name, int flags) |
allocate the page ftl structure's members More... | |
int | page_ftl_close (struct page_ftl *) |
deallocate the page ftl structure's members More... | |
ssize_t | page_ftl_submit_request (struct page_ftl *, struct device_request *) |
submit the request to the valid function More... | |
ssize_t | page_ftl_write (struct page_ftl *, struct device_request *) |
the core logic for writing the request to the device. More... | |
ssize_t | page_ftl_read (struct page_ftl *, struct device_request *) |
the core logic for reading the request to the device. More... | |
int | page_ftl_module_init (struct flash_device *, uint64_t flags) |
initialize the page flash translation layer module More... | |
int | page_ftl_module_exit (struct flash_device *) |
free resources in the page flash translation layer module More... | |
struct device_address | page_ftl_get_free_page (struct page_ftl *) |
get page from the segment More... | |
int | page_ftl_update_map (struct page_ftl *, size_t sector, uint32_t ppn) |
int | page_ftl_segment_data_init (struct page_ftl *, struct page_ftl_segment *) |
initialize the page ftl's segment data only More... | |
int | page_ftl_do_gc (struct page_ftl *) |
core logic of the garbage collection More... | |
static size_t | page_ftl_get_map_size (struct page_ftl *pgftl) |
static size_t | page_ftl_get_lpn (struct page_ftl *pgftl, size_t sector) |
static size_t | page_ftl_get_page_offset (struct page_ftl *pgftl, size_t sector) |
static size_t | page_ftl_get_segment_number (struct page_ftl *pgftl, uintptr_t segment) |
declaration of data structures and macros for page ftl
#define PAGE_FTL_CACHE_SIZE (2) |
#define PAGE_FTL_GC_RATIO |
maximum the number of segments garbage collected
#define PAGE_FTL_GC_THRESHOLD |
gc triggered when number of the free pages under threshold
int page_ftl_close | ( | struct page_ftl * | pgftl | ) |
deallocate the page ftl structure's members
pgftl | pointer of the page ftl structure |
int page_ftl_do_gc | ( | struct page_ftl * | pgftl | ) |
core logic of the garbage collection
pgftl | pointer of the page FTL structure |
struct device_address page_ftl_get_free_page | ( | struct page_ftl * | pgftl | ) |
get page from the segment
pgftl | pointer of the page-ftl structure |
|
static |
|
static |
|
static |
|
static |
int page_ftl_module_exit | ( | struct flash_device * | flash | ) |
free resources in the page flash translation layer module
flash | pointer of the flash device information |
int page_ftl_module_init | ( | struct flash_device * | flash, |
uint64_t | flags | ||
) |
initialize the page flash translation layer module
flash | pointer of the flash device information |
flags | flags for flash and submodule |
int page_ftl_open | ( | struct page_ftl * | pgftl, |
const char * | name, | ||
int | flags | ||
) |
allocate the page ftl structure's members
pgftl | pointer of the page ftl structure |
name | file's name for open |
flags | flags for open |
initialize the mapping table
ssize_t page_ftl_read | ( | struct page_ftl * | pgftl, |
struct device_request * | request | ||
) |
the core logic for reading the request to the device.
pgftl | pointer of the page FTL structure |
request | user's request pointer |
< YOU MUST TAKE CARE OF THIS LINE
int page_ftl_segment_data_init | ( | struct page_ftl * | pgftl, |
struct page_ftl_segment * | segment | ||
) |
initialize the page ftl's segment data only
pgftl | pointer of the page-ftl structure |
segment | pointer of the target segment |
ssize_t page_ftl_submit_request | ( | struct page_ftl * | pgftl, |
struct device_request * | request | ||
) |
submit the request to the valid function
pgftl | pointer of the page ftl structure |
request | pointer of the request |
int page_ftl_update_map | ( | struct page_ftl * | , |
size_t | sector, | ||
uint32_t | ppn | ||
) |
ssize_t page_ftl_write | ( | struct page_ftl * | pgftl, |
struct device_request * | request | ||
) |
the core logic for writing the request to the device.
pgftl | pointer of the page FTL structure |
request | user's request pointer |
< global data retrieve