mufs: sync writes
This commit is contained in:
parent
58c93eecf4
commit
070c36a361
2 changed files with 11 additions and 0 deletions
|
@ -32,6 +32,9 @@ int mufs_mark_block(struct mufs *fs, uint32_t block, int status)
|
|||
sizeof data) == 0)
|
||||
return -1;
|
||||
|
||||
if (flash_sync(fs->dev) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,9 @@ static int mufs_do_lookup(struct mufs *fs, uint32_t *page,
|
|||
if (flash_write(dev, (base << dev->log2_block_size) +
|
||||
index * sizeof entry, &entry, sizeof entry) == 0)
|
||||
return -1;
|
||||
|
||||
if (flash_sync(dev) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return mufs_do_lookup(fs, page, entry, depth - 1, va, new_page,
|
||||
|
@ -171,6 +174,11 @@ int mufs_extend_tree(struct mufs_tree *tree, uint8_t depth)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (flash_sync(dev) < 0) {
|
||||
mufs_free_block(fs, root);
|
||||
return -1;
|
||||
}
|
||||
|
||||
tree->root = root;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue