Open
Conversation
Imported littlefs v2.8.1 from https://github.com/littlefs-project/littlefs commit c733d9ec5776dfc949ec6dc71fa9ce3ff71de6e5 JIRA: RTOS-686
remove trailing whitespace fix comments to satisfy codespell JIRA: RTOS-686
change error handling in lfs_fs_rawgrow() JIRA: RTOS-686
move block device operations to separate file export selected functions from lfs.c JIRA: RTOS-686
JIRA: RTOS-686
link function implemented as "move" JIRA: RTOS-686
bdaceb3 to
b92ebe9
Compare
fix compilation warnings with 32-bit IDs add API for mounting with explicit configuration JIRA: RTOS-686
754c75d to
7019e91
Compare
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for LittleFS filesystem to Phoenix RTOS.
Description
LittleFS is a high-integrity filesystem designed for use on relatively small Flash memory devices. This driver allows the use of LittleFS with Phoenix RTOS.
Because of the requirements of Phoenix RTOS API, every file is given a unique numeric identifier that is stored on disk. To achieve good performance, after a path lookup the ID of the file, along with its location on the disk, is cached in memory. In case of a cache miss, the entire file system needs to be scanned to find the file corresponding to an ID. In practice, most file operations in Phoenix RTOS are preceded by a lookup operation, so the requested file's data is very likely cached in memory (unless the cache is too small).
This driver can handle situations where a file has no ID stored on disk - in this case, an ID will be written to disk upon lookup or (if mounted in read-only mode) stored permanently in memory.
Due to the construction of LittleFS, hard links were not implemented. As a result, this driver is not fully compatible with Phoenix RTOS API, which expects the
linksyscall to create hard links andunlinkto remove them. Instead, in this driverlinkrenames a file andunlinkremoves a file. As a result, the "rename" operation in Phoenix RTOS - which is implemented as alinkthenunlink- always fails due to theunlinkoperation failing to find the file (which has already been moved bylink).Sparse files are not implemented, which causes one of
libctests to fail.Both little-endian and big-endian systems are supported. Mounting of other filesystems within LittleFS is supported (also in read-only mode).
For now this file system has only been tested with
pc-atadriver onia32-generic-qemu.Motivation and Context
Due to its characteristics, LittleFS is a good filesystem for use on STM32L4 targets.
Types of changes
How Has This Been Tested?
Checklist:
Special treatment