mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-11-16 04:24:35 +00:00
Renamed lfs_fs_findfreeblocks -> lfs_fs_gc, tweaked documentation
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.
This commit is contained in:
15
lfs.h
15
lfs.h
@@ -712,12 +712,17 @@ lfs_ssize_t lfs_fs_size(lfs_t *lfs);
|
||||
// Returns a negative error code on failure.
|
||||
int lfs_fs_traverse(lfs_t *lfs, int (*cb)(void*, lfs_block_t), void *data);
|
||||
|
||||
// Use Traverse function and try to find free blocks. LittleFS free blocks
|
||||
// search is unpredictable.
|
||||
// Attempt to proactively find free blocks
|
||||
//
|
||||
// Search is costly operation which may delay write. In realtime write
|
||||
// scenarios can be better to find them before a write.
|
||||
int lfs_fs_findfreeblocks(lfs_t *lfs);
|
||||
// Calling this function is not required, but may allowing the offloading of
|
||||
// the expensive block allocation scan to a less time-critical code path.
|
||||
//
|
||||
// Note: littlefs currently does not persist any found free blocks to disk.
|
||||
// This may change in the future.
|
||||
//
|
||||
// Returns a negative error code on failure. Finding no free blocks is
|
||||
// not an error.
|
||||
int lfs_fs_gc(lfs_t *lfs);
|
||||
|
||||
#ifndef LFS_READONLY
|
||||
// Attempt to make the filesystem consistent and ready for writing
|
||||
|
||||
Reference in New Issue
Block a user