littlefs2
littlefs2 copied to clipboard
Improve iteration capability
Iteration over a directory is not very efficient, as it can't be safely paused and resumed. This leads to issues. For example in trussed, as a consequence the iteration happens at a speed of $O(n^2)$ because of this: https://github.com/trussed-dev/trussed/blob/main/src/store/filestore.rs#L335
The raw c API exposes a lfs_dir_tell
, which littlefs can use to "store" the current iteration position and return to using lfs_dir_seek
Trying to implement it lead to discovering a bug in littelfs: https://github.com/littlefs-project/littlefs/issues/785