diff options
author | Juerg Rast <juergr@gmail.com> | 2018-03-07 23:52:43 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2018-03-13 05:26:40 +0300 |
commit | 5c4ee2109de6aab794696c693ecb12e9791ea2d9 (patch) | |
tree | 6908b8e99bab4f8e71c388d1c4d5b421fb9283d4 | |
parent | 155224600a496e69c26867592cabcbd49464d86c (diff) |
Added a note about the callback functions
Added a short section about the callback functions, based on the answers
to issue #35 and #36
-rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -120,6 +120,18 @@ really do anything to ensure that the data written to disk is machine portable. This is fine as long as all of the involved machines share endianness (little-endian) and don't have strange padding requirements. +In the configuration struct, the `prog` and `erase` function provided by the +user may return a `LFS_ERR_CORRUPT` error if the implementation already can +detect corrupt blocks. However, the wear leveling does not depend on the return +code of these functions, instead all data is read back and checked for +integrity. + +If your storage caches writes, make sure that the provided `sync` function +flushes all the data to memory and ensures that the next read fetches the data +from memory, otherwise data integrity can not be guaranteed. If the `write` +function does not perform caching, and therefore each `read` or `write` call +hits the memory, the `sync` function can simply return 0. + ## Reference material [DESIGN.md](DESIGN.md) - DESIGN.md contains a fully detailed dive into how |