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
2024-01-16Relaxed alignment requirements for lfs_mallocrelaxed-lookaheadChristopher Haster
The only reason we needed this alignment was for the lookahead buffer. Now that the lookahead buffer is relaxed to operate on bytes, we can relax our malloc alignment requirement all the way down to the byte level, since we mainly use lfs_malloc to allocate byte-level buffers. This does introduce a risk that we might need word-level mallocs in the future. If that happens we will need to decide if changing the malloc alignment is a breaking change, or gate alignment requirements behind user provided defines. Found by HiFiPhile.
2023-12-20Relaxed lookahead buffer alignmentChristopher Haster
This drops the lookahead buffer from operating on 32-bit words to operating on 8-bit bytes, and removes any alignment requirement. This may have some minor performance impact, but it is unlikely to be significant when you consider IO overhead. The original motivation for 32-bit alignment was an attempt at future-proofing in case we wanted some more complex on-disk data structure. This never happened, and even if it did, it could have been added via additional config options. This has been a significant pain point for users, since providing word-aligned byte-sized buffers in C can be a bit annoying.
2023-12-20Reworked the block allocator so the logic is hopefully simplerChristopher Haster
Some of this is just better documentation, some of this is reworking the logic to be more intention driven... if that makes sense...
2023-12-20Renamed a number of internal block-allocator fieldsChristopher Haster
- Renamed lfs.free -> lfs.lookahead - Renamed lfs.free.off -> lfs.lookahead.start - Renamed lfs.free.i -> lfs.lookahead.next - Renamed lfs.free.ack -> lfs.lookahead.ckpoint - Renamed lfs_alloc_ack -> lfs_alloc_ckpoint These have been named a bit confusingly, and I think the new names make their relevant purposes a bit clearer. At the very it's clear lfs.lookahead is related to the lookahead buffer. (and doesn't imply a closed free-bitmap).
2023-10-31Merge pull request #884 from DvdGiessen/static-functionsv2.8.1Christopher Haster
lfs_fs_raw* functions should be static
2023-10-24Added -Wmissing-prototypesChristopher Haster
This warning is useful for catching the easy mistake of missing the keyword static on functions intended to be internal-only. Missing the static keyword risks symbol polution and misses potential compiler optimizations. This is an interesting warning, while useful for libraries such as littlefs, it's perfectly valid C to not predeclare all functions, and common in final application binaries. Relatedly, this warning is re-disabled for the test/bench runner. There may be a better way to organize the CFLAGS, maybe into separate LIB/RUNNER CFLAGS, but I'll leave this to future work if our CFLAGS grow more complicated. This was motivated by non-static internal-only functions leaking into a release. Found and fixed by DvdGiessen.
2023-10-23lfs_fs_raw* functions should be staticDaniël van de Giessen
2023-09-22Merge pull request #877 from littlefs-project/develv2.8.0Christopher Haster
Minor release: v2.8
2023-09-21Bumped minor version to v2.8Christopher Haster
2023-09-21Merge pull request #875 from littlefs-project/fs-gcChristopher Haster
Add lfs_fs_gc to enable proactive finding of free blocks
2023-09-21Renamed lfs_fs_findfreeblocks -> lfs_fs_gc, tweaked documentationfs-gcChristopher Haster
The idea is in the future this function may be extended to support other block janitorial work. In such a case calling this lfs_fs_gc provides a more general name that can include other operations. This is currently just wishful thinking, however.
2023-09-21Extended alloc tests to test some properties of lfs_fs_findfreeblocksChristopher Haster
- Test that the code actually runs. - Test that lfs_fs_findfreeblocks does not break block allocations. - Test that lfs_fs_findfreeblocks does not error when no space is available, it should only errors when the block is actually needed.
2023-09-21Added API boilerplate for lfs_fs_findfreeblocks and consistent styleChristopher Haster
This adds the tracing and optional locking for the littlefs API. Also updated to match the code style, and added LFS_READONLY guards where necessary.
2023-09-21Move lookahead buffer offset at the first free block if such block doesn't ↵ondrap
exist move it for whole lookahead size.
2023-09-21Update lfs_find_free_blocks to match the latest changes.ondrap
2023-09-21Merge pull request #872 from littlefs-project/fs-growChristopher Haster
Add lfs_fs_grow to enable limited resizing of the filesystem
2023-09-21Merge pull request #866 from BrianPugh/optional-block-countChristopher Haster
Infer block_count from superblock if not provided in config.
2023-09-12Added lfs_fs_grow for growing the filesystem to a different block_countfs-growChristopher Haster
The initial implementation for this was provided by kaetemi, originally as a mount flag. However, it has been modified here to be self-contained in an explicit runtime function that can be called after mount. The reasons for an explicit function: 1. lfs_mount stays a strictly readonly operation, and avoids pulling in all of the write machinery. 2. filesystem-wide operations such as lfs_fs_grow can be a bit risky, and irreversable. The action of growing the filesystem should be very intentional. --- One concern with this change is that this will be the first function that changes metadata in the superblock. This might break tools that expect the first valid superblock entry to contain the most recent metadata, since only the last superblock in the superblock chain will contain the updated metadata.
2023-09-12Tweaked lfs_fsinfo block_size/block_count fieldsChristopher Haster
Mainly to match superblock ordering and emphasize these are logical blocks.
2023-09-12Added a couple mixed/unknown block_count testsChristopher Haster
These were cherry-picked from some previous work on a related feature.
2023-09-12Adopted erase_size/erase_count config in test block-devices/runnersChristopher Haster
In separating the configuration of littlefs from the physical geometry of the underlying device, we can no longer rely solely on lfs_config to contain all of the information necessary for the simulated block devices we use for testing. This adds a new lfs_*bd_config struct for each of the block devices, and new erase_size/erase_count fields. The erase_* name was chosen since these reflect the (simulated) physical erase size and count of erase-sized blocks, unlike the block_* variants which represent logical block sizes used for littlefs's bookkeeping. It may be worth adopting erase_size/erase_count in littlefs's config at some point in the future, but at the moment doesn't seem necessary. Changing the lfs_bd_config structs to be required is probably a good idea anyways, as it moves us more towards separating the bds from littlefs. Though we can't quite get rid of the lfs_config parameter because of the block-device API in lfs_config. Eventually it would be nice to get rid of it, but that would require API breakage.
2023-09-03Revert of refactor lfs_scan_* out of lfs_formatChristopher Haster
This would result in two passes through the superblock chain during mount, when we can access everything we need to in one.
2023-09-03Merge pull request #863 from littlefs-project/fix-conversion-warningv2.7.1Christopher Haster
Fix integer conversion warning from Code Composer Studio
2023-09-03Merge pull request #855 from mdahamshi/mmd_fixChristopher Haster
initlize struct lfs_diskoff disk = {0}
2023-09-03Merge pull request #849 from littlefs-project/fix-ci-release-no-versionChristopher Haster
Fix release script breaking if there is no previous version
2023-08-21remove previous block_count detection from lfs_formatBrian Pugh
2023-08-20Add block_count and block_size to fsinfoBrian Pugh
2023-08-20lintingBrian Pugh
2023-08-18forgot to unmount lfs in test; leaking memoryBrian Pugh
2023-08-18fix newly introduced missing cleanup when an invalid superblock is found.Brian Pugh
2023-08-18test for failure when interpretting block count when formatting without ↵Brian Pugh
superblock
2023-08-18Add test_superblocks_mount_unknown_block_countBrian Pugh
2023-08-18fix corruption checkBrian Pugh
2023-08-17Add a unit test; currently hanging on final permutation.Brian Pugh
Some block-device bound-checks are disabled during superblock search.
2023-08-17introduce lfs->block_count. If cfg->block_count is 0, autopopulate from ↵Brian Pugh
superblock
2023-08-17remove redundant superblock checkBrian Pugh
2023-08-17refactor lfs_scan_for_state_updates and lfs_scan_for_superblock out of ↵Brian Pugh
lfs_format
2023-08-03initlize struct lfs_diskoff disk = {0}Mohammad Dahamshi
so we don't use it uninitlized in first run
2023-08-03Fixed integer conversion warning from Code Composer Studiofix-conversion-warningChristopher Haster
Proposed by FiddlingBits
2023-07-03Fixed release script breaking if there is no previous versionfix-ci-release-no-versionChristopher Haster
This can't actually happen in the current state of the littlefs GitHub repo, but could in theory cause problems if CI is enabled on a fork. Found while enabling GitHub Actions on littlefs-fuse.
2023-06-30Merge pull request #848 from littlefs-project/develv2.7.0Christopher Haster
Minor release: v2.7
2023-06-30Bumped minor version to v2.7Christopher Haster
2023-06-30Merge pull request #846 from littlefs-project/link-chan-fatfsChristopher Haster
Add a link to ChaN's FatFS implementation
2023-06-30Merge pull request #839 from littlefs-project/configurable-disk-versionChristopher Haster
Add support for writing previous on-disk minor versions
2023-06-30Merge pull request #838 from littlefs-project/fs-statChristopher Haster
Add lfs_fs_stat for access to filesystem status/configuration
2023-06-29Added LFS_MULTIVERSION and testing of lfs2.0 to CIconfigurable-disk-versionChristopher Haster
- Added test-multiversion test job - Added test-lfs2_0 test job - Added mutliversion size measurement
2023-06-29Added LFS_MULTIVERSION, made lfs2.0 support a compile-time optionChristopher Haster
The code-cost wasn't that bad: 16556 B -> 16754 B (+1.2%) But moving write support of older versions behind a compile-time flag allows us to be a bit more liberal with what gets added to support older versions, since the cost won't hit most users.
2023-06-29Added support for writing on-disk version lfs2.0Christopher Haster
The intention is to help interop with older minor versions of littlefs. Unfortunately, since lfs2.0 drivers cannot mount lfs2.1 images, there are situations where it would be useful to write to write strictly lfs2.0 compatible images. The solution here adds a "disk_version" configuration option which determines the behavior of lfs2.1 dependent features. Normally you would expect this to only change write behavior. But since the main change in lfs2.1 increased validation of erased data, we also need to skip this extra validation (fcrc) or see terrible slowdowns when writing.
2023-06-29Removed fsinfo.block_usage for nowfs-statChristopher Haster
In terms of ease-of-use, a user familiar with other filesystems expects block_usage in fsinfo. But in terms of practicality, block_usage can be expensive to find in littlefs, so if it's not needed in the resulting fsinfo, that operation is wasteful. It's not clear to me what the best course of action is, but since block_usage can always be added to fsinfo later, but not removed without breaking backwards compatibility, I'm leaving this out for now. Block usage can still be found by explicitly calling lfs_fs_size.
2023-06-26Added a link to ChaN's FatFS implementationlink-chan-fatfsChristopher Haster
ChaN's FAT implementation definitely deserves a mention here, since it was one of the first open-source microcontroller-oriented filesystem implementations that I'm aware of, and has a lot of good ideas at the implementation level. Honestly I didn't realize this wasn't already linked to from here. If you're using FAT on a microcontroller, it's most likely this library.