ftl: cache last virtual address translation

This commit is contained in:
S.J.R. van Schaik 2017-07-24 13:09:48 +02:00
parent bc50af00b6
commit 8f061a808d
2 changed files with 8 additions and 0 deletions

View file

@ -379,6 +379,9 @@ int trace_path(struct ftl_map *map, struct ftl_page_desc *new_page_desc,
uint8_t depth = 0;
uint32_t upage = map->root;
if (map->last_va == va)
return map->last_pa;
if (new_page_desc)
new_page_desc->va = va;
@ -414,6 +417,9 @@ int trace_path(struct ftl_map *map, struct ftl_page_desc *new_page_desc,
if (page)
*page = upage;
map->last_va = va;
map->last_pa = upage;
return 0;
err_not_found: