littlefs2 icon indicating copy to clipboard operation
littlefs2 copied to clipboard

Improve iteration capability

Open sosthene-nitrokey opened this issue 1 year ago • 1 comments

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

sosthene-nitrokey avatar Mar 10 '23 14:03 sosthene-nitrokey

Trying to implement it lead to discovering a bug in littelfs: https://github.com/littlefs-project/littlefs/issues/785

sosthene-nitrokey avatar Mar 13 '23 13:03 sosthene-nitrokey