ftl: use write_page_desc() in ftl_trim()

tags/0.1.0
S.J.R. van Schaik 7 years ago
parent 7a3e5a7679
commit 22028021ca
  1. 5
      source/ftl/ftl.c
  2. 2
      source/ftl/map.c
  3. 2
      source/ftl/map.h

@ -125,7 +125,10 @@ int ftl_trim(struct ftl_map *map, uint32_t va)
alt_page << map->log2_page_size, 1 << map->log2_page_size) == 0)
return -1;
return write_upage(map, NULL, &page_desc);
if (prepare_head(map) < 0)
return -1;
return write_page_desc(map, &page_desc);
}
/* Returns the amount of used pages with a unique virtual address multiplied by

@ -83,7 +83,7 @@ int read_page_desc(struct ftl_map *map,
/* Writes the page descriptor to the footer of the current page group and
* increments the head to point to the next free user page.
*/
static int write_page_desc(struct ftl_map *map,
int write_page_desc(struct ftl_map *map,
const struct ftl_page_desc *page_desc)
{
struct ftl_page_group group;

@ -6,6 +6,8 @@ int read_page_group(struct ftl_map *map,
struct ftl_page_group *group, uint32_t group_no);
int read_page_desc(struct ftl_map *map,
struct ftl_page_desc *page_desc, uint32_t upage);
int write_page_desc(struct ftl_map *map,
const struct ftl_page_desc *page_desc);
int write_upage(struct ftl_map *map, const void *page,
const struct ftl_page_desc *page_desc);
int trace_path(struct ftl_map *map, struct ftl_page_desc *new_page_desc,

Loading…
Cancel
Save