ftl: check outstanding flags in ftl_seek()

This commit is contained in:
S.J.R. van Schaik 2017-10-03 14:24:34 +02:00
parent 52a7ec1fae
commit dddba0af8f

View file

@ -79,7 +79,6 @@ static int ftl_seek(struct ftl_map *map, uint32_t va)
{
size_t len;
uint32_t offset, dst, src;
int ret;
if (va >= ftl_get_capacity(map))
return -1;
@ -100,7 +99,7 @@ static int ftl_seek(struct ftl_map *map, uint32_t va)
src = map->outstanding.page << map->log2_page_size;
len = offset - map->offset;
if (ret == -ERR_NOT_FOUND)
if (map->outstanding.flags & FTL_NO_MAPPING)
flash_write0(map->dev, dst, len);
else
flash_copy(map->dev, dst, src, len);