22 #define PAGE_FTL_CACHE_SIZE (2) 23 #define PAGE_FTL_GC_RATIO \ 26 #define PAGE_FTL_GC_THRESHOLD \ 30 enum { PAGE_FTL_IOCTL_TRIM = 0, 58 #ifdef PAGE_FTL_USE_GLOBAL_RWLOCK 59 pthread_rwlock_t rwlock;
109 return (segment - (uintptr_t)pgftl->
segments) /
pthread_rwlock_t * bus_rwlock
Definition: page.h:57
int page_ftl_module_init(struct flash_device *, uint64_t flags)
initialize the page flash translation layer module
Definition: page-interface.c:336
static size_t page_ftl_get_page_offset(struct page_ftl *pgftl, size_t sector)
Definition: page.h:100
uint32_t * trans_map
Definition: page.h:51
uint64_t * gc_seg_bits
Definition: page.h:65
int o_flags
Definition: page.h:62
generic device address format
Definition: device.h:95
pthread_mutex_t mutex
Definition: page.h:55
GList * lpn_list
Definition: page.h:44
int page_ftl_close(struct page_ftl *)
deallocate the page ftl structure's members
Definition: page-core.c:432
static size_t page_ftl_get_map_size(struct page_ftl *pgftl)
Definition: page.h:89
pthread_t gc_thread
Definition: page.h:61
int page_ftl_update_map(struct page_ftl *, size_t sector, uint32_t ppn)
pthread_rwlock_t gc_rwlock
Definition: page.h:56
int page_ftl_module_exit(struct flash_device *)
free resources in the page flash translation layer module
Definition: page-interface.c:379
int page_ftl_open(struct page_ftl *, const char *name, int flags)
allocate the page ftl structure's members
Definition: page-core.c:228
metadata of the device
Definition: device.h:163
int page_ftl_segment_data_init(struct page_ftl *, struct page_ftl_segment *)
initialize the page ftl's segment data only
Definition: page-core.c:151
ssize_t page_ftl_submit_request(struct page_ftl *, struct device_request *)
submit the request to the valid function
Definition: page-core.c:345
gint is_gc
Definition: page.h:41
ssize_t page_ftl_write(struct page_ftl *, struct device_request *)
the core logic for writing the request to the device.
Definition: page-write.c:147
contain the page flash translation layer information
Definition: page.h:50
int page_ftl_do_gc(struct page_ftl *)
core logic of the garbage collection
Definition: page-gc.c:251
uint64_t * use_bits
Definition: page.h:43
uint64_t alloc_segnum
Definition: page.h:52
gint nr_valid_pages
Definition: page.h:40
struct device_address page_ftl_get_free_page(struct page_ftl *)
get page from the segment
Definition: page-map.c:22
static size_t device_get_total_size(struct device *dev)
total size of a flash board
Definition: device.h:248
static size_t page_ftl_get_lpn(struct page_ftl *pgftl, size_t sector)
Definition: page.h:95
segment information structure
Definition: page.h:38
struct page_ftl_segment * segments
Definition: page.h:53
struct device * dev
Definition: ramdisk-test.c:10
contain the device information header
GList * gc_list
Definition: page.h:64
gint nr_free_pages
Definition: page.h:39
static size_t page_ftl_get_segment_number(struct page_ftl *pgftl, uintptr_t segment)
Definition: page.h:106
generic flash control interfaces' header
struct device * dev
Definition: page.h:54
contain the flash device information
Definition: flash.h:31
static size_t device_get_page_size(struct device *dev)
get flash board's NAND page size
Definition: device.h:232
ssize_t page_ftl_read(struct page_ftl *, struct device_request *)
the core logic for reading the request to the device.
Definition: page-read.c:56
request for device
Definition: device.h:110