Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-21Merge remote-tracking branch 'origin/master' into v2-rebase-part2Christopher Haster
2018-10-16Merge remote-tracking branch 'origin/master' into v2-alphaChristopher Haster
2018-10-16Added support for custom attributes leveraging the new metadata loggingChristopher Haster
Now that littlefs has been rebuilt almost from the ground up with the intention to support custom attributes, adding in custom attribute support is relatively easy. The highest bit in the 9-bit type structure indicates that an attribute is a user-specified custom attribute. The user then has a full 8-bits to specify the attribute type. Other than that, custom attributes are treated the same as system-level attributes. Also made some tweaks to custom attributes: - Adopted the opencfg for file-level attributes provided by dpgeorge - Changed setattrs/getattrs to the simpler setattr/getattr functions users will probably be more familiar with. Note that multiple attributes can still be committed atomically with files, though not with directories. - Changed LFS_ATTRS_MAX -> LFS_ATTR_MAX since there's no longer a global limit on the sum of attribute sizes, which was rather confusing. Though they are still limited by what can fit in a metadata-pair.
2018-10-10Added tests for resizable entries and custom attributesChristopher Haster
Also found some bugs. Should now have a good amount of confidence in these features.
2018-09-29Fix -Wsign-compare errorVincent Dupont
2018-09-27Added -Wjump-misses-init and fixed uninitialized warningsChristopher Haster
2018-07-10Added quality of life improvements for main.c/test.c issuesChristopher Haster
1. Added check for main.c and test.c to decide compilation target 2. Added step to remove test.c after successful test completion The test.c file, which contains the expanded test main, is useful when debugging why tests are failing. However, keeping the test.c file around causes problems when a later attempt is made to compile a larger project containing the littlefs directory. Under (hopefully) normal operation, tests always pass. So it should be ok to remove the test.c file after a successful test run. Hopefully this behaviour doesn't cause too much confusion for contributors using the tests. On the other side of things, compiling the library with no main ends (successfully) with the "main not found" error message. By defaulting to lfs.a if neither test.c/main.c is avoid this in the common cases found by armijnhemel and Sim4n6
2018-07-02Fixed shadowed variable warningsDamien George
- Fixed shadowed variable warnings in lfs_dir_find. - Fixed unused parameter warnings when LFS_NO_MALLOC is enabled. - Added extra warning flags to CFLAGS. - Updated tests so they don't shadow the "size" variable for -Wshadow
2018-04-09Renamed test_parallel tests to test_interespersedChristopher Haster
The name test_parallel gave off the incorrect impression that these tests are multithreaded.
2018-02-19Added cross-compile targets for testingChristopher Haster
Using gcc cross compilers and qemu: - make test CC="arm-linux-gnueabi-gcc --static -mthumb" EXEC="qemu-arm" - make test CC="powerpc-linux-gnu-gcc --static" EXEC="qemu-ppc" - make test CC="mips-linux-gnu-gcc --static" EXEC="qemu-mips" Also separated out Travis jobs and added some size reporting
2018-02-02Do not print command invocation if QUIETBernhard Reutner-Fischer
2018-01-30Moved -Werror flag to CI onlyChristopher Haster
The most useful part of -Werror is preventing code from being merged that has warnings. However it is annoying for users who may have different compilers with different warnings. Limiting -Werror to CI only covers the main concern about warnings without limiting users.
2018-01-21Added lfs_file_truncateChristopher Haster
As a copy-on-write filesystem, the truncate function is a very nice function to have, as it can take advantage of reusing the data already written out to disk.
2017-11-22Fixed pipefail issue that was preventing CI from reporting errorsChristopher Haster
2017-11-17Added QUIET flag to tests so CI is readableChristopher Haster
2017-10-10Added atomic move using dirty tag in entry typeChristopher Haster
The "move problem" has been present in littlefs for a while, but I haven't come across a solution worth implementing for various reasons. The problem is simple: how do we move directory entries across directories atomically? Since multiple directory entries are involved, we can't rely entirely on the atomic block updates. It ends up being a bit of a puzzle. To make the problem more complicated, any directory block update can fail due to wear, and cause the directory block to need to be relocated. This happens rarely, but brings a large number of corner cases. --- The solution in this patch is simple: 1. Mark source as "moving" 2. Copy source to destination 3. Remove source If littlefs ever runs into a "moving" entry, that means a power loss occured during a move. Either the destination entry exists or it doesn't. In this case we just search the entire filesystem for the destination entry. This is expensive, however the chance of a power loss during a move is relatively low.
2017-05-15Added support for handling corrupted blocksChristopher Haster
This provides a limited form of wear leveling. While wear is not actually balanced across blocks, the filesystem can recover from corrupted blocks and extend the lifetime of a device nearly as much as dynamic wear leveling. For use-cases where wear is important, it would be better to use a full form of dynamic wear-leveling at the block level. (or consider a logging filesystem). Corrupted block handling was simply added on top of the existing logic in place for the filesystem, so it's a bit more noodly than it may have to be, but it gets the work done.
2017-05-08Added proper handling for removing open filesChristopher Haster
Conveniently we previously added a linked-list of files for things like this. This should handle most of the corner cases where files are open during strange operations. This also brings up the point that we aren't doing anything similar for directories and don't even have a dir linked-list. After thinking about it for a while, I've decided to leave out this handling for dirs. It will likely be very complicated, with little gains as directories are less used in embedded systems. Additionally, dirs are only open for reading, and corruption will probably just cause the dir iteration to terminate. If needed, correct handling of open directories can be added later.
2017-04-23Added support for full seek operationsChristopher Haster
A rather involved upgrade for both files and directories, seek and related functions are now completely supported: - lfs_file_seek - lfs_file_tell - lfs_file_rewind - lfs_file_size - lfs_dir_seek - lfs_dir_tell - lfs_dir_rewind This change also highlighted the concern that lfs_off_t is unsigned, whereas off_t is traditionally signed. Unfortunately, lfs_off_t is already used intensively through the codebase, so in focusing on moving forward and avoiding getting bogged down by details, I'm going to keep it as is and use the signed type lfs_soff_t where necessary.
2017-04-18Restructured directory codeChristopher Haster
After quite a bit of prototyping, settled on the following functions: - lfs_dir_alloc - create a new dir - lfs_dir_fetch - load and check a dir pair from disk - lfs_dir_commit - save a dir pair to disk - lfs_dir_shift - shrink a dir pair to disk - lfs_dir_append - add a dir entry, creating dirs if needed - lfs_dir_remove - remove a dir entry, dropping dirs if needed Additionally, followed through with a few other tweaks
2017-04-18Added dir navigation without needing parent entriesChristopher Haster
This should be the last step to removing the need for parent entries. Parent entries cause all sort of problems with atomic directory updates, especially related to moving/deleting directories. I couldn't figure out a parser for '..' entries without, O(n^2) runtime, a stack, or modifying the path itself. Since the goal is constant memory consumption, I went with the O(n^2) runtime solution, but this may need to be optimized later.
2017-04-18Moved to brute-force deorphan without parent pointersChristopher Haster
Removing the dependency to the parent pointer solves many issues with non-atomic updates of children's parent pointers with respect to any move operations. However, this comes with an embarrassingly terrible runtime as the only other option is to exhaustively check every dir entry to find a child's parent. Fortunately, deorphaning should be a relatively rare operation.
2017-04-18Added full dir list and rudimentary block allocatorChristopher Haster
In writing the initial allocator, I ran into the rather difficult problem of trying to iterate through the entire filesystem cheaply and with only constant memory consumption (which prohibits recursive functions). The solution was to simply thread all directory blocks onto a massive linked-list that spans the entire filesystem. With the linked-list it was easy to create a traverse function for all blocks in use on the filesystem (which has potential for other utility), and add the rudimentary block allocator using a bit-vector. While the linked-list may add complexity (especially where needing to maintain atomic operations), the linked-list helps simplify what is currently the most expensive operation in the filesystem, with no cost to space (the linked-list can reuse the pointers used for chained directory blocks).
2017-03-26Added dir tests, test fixes, configChristopher Haster
2017-03-26Added a rudimentary test frameworkChristopher Haster
Tests can be found in 'tests/test_blah.sh' Tests can be run with 'make test'
2017-02-27Adopted ctz skip-list structure earlier than expectedChristopher Haster
The primary data structure backing the little fs was planned to be a little ctz based skip-list for O(logn) lookup and O(1) append. Was initially planning to start with a simple linked list of index blocks, but was having trouble implementing the free-list on top of the structure. Went ahead and adopted the skip-list structure since it may have actually been easier.
2017-02-25Initial commit of block device interface and emulated block deviceChristopher Haster