ftl: return -1 when no root could be found

tags/0.1.0
S.J.R. van Schaik 8 years ago
parent 5b21fe9813
commit 51da9338ea
  1. 4
      source/ftl/map.c

@ -286,15 +286,17 @@ static int find_root(struct ftl_map *map, uint32_t group)
{
struct ftl_page_desc page_desc;
uint32_t upage;
int ret = -1;
upage = group << map->log2_pages_per_group;
while (read_page_desc(map, &page_desc, upage) == 0) {
map->root = upage;
ret = 0;
upage = next_upage(map, upage);
}
return 0;
return ret;
}
/* Attempts to find the first free page within a page group by looking for the

Loading…
Cancel
Save