ftl: return -1 when no root could be found
This commit is contained in:
parent
5b21fe9813
commit
51da9338ea
1 changed files with 3 additions and 1 deletions
|
@ -286,15 +286,17 @@ static int find_root(struct ftl_map *map, uint32_t group)
|
||||||
{
|
{
|
||||||
struct ftl_page_desc page_desc;
|
struct ftl_page_desc page_desc;
|
||||||
uint32_t upage;
|
uint32_t upage;
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
upage = group << map->log2_pages_per_group;
|
upage = group << map->log2_pages_per_group;
|
||||||
|
|
||||||
while (read_page_desc(map, &page_desc, upage) == 0) {
|
while (read_page_desc(map, &page_desc, upage) == 0) {
|
||||||
map->root = upage;
|
map->root = upage;
|
||||||
|
ret = 0;
|
||||||
upage = next_upage(map, upage);
|
upage = next_upage(map, upage);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attempts to find the first free page within a page group by looking for the
|
/* Attempts to find the first free page within a page group by looking for the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue