Cleaned up block allocator

Removed scanning for stride
- Adds complexity with questionable benefit
- Can be added as an optimization later

Fixed handling around device boundaries and where lookahead may not be a
factor of the device size (consider small devices with only a few
blocks)

Added support for configuration with optional dynamic memory as found in
the caching configuration
This commit is contained in:
Christopher Haster
2017-04-22 14:56:12 -05:00
parent 7050922623
commit aa872657d2
4 changed files with 92 additions and 95 deletions

View File

@@ -23,11 +23,6 @@ typedef uint32_t lfs_block_t;
#define LFS_NAME_MAX 255
#endif
// Lookahead distance
#ifndef LFS_CFG_LOOKAHEAD
#define LFS_CFG_LOOKAHEAD 128
#endif
// Logging operations
#include <stdio.h>
#define LFS_ERROR(fmt, ...) printf("lfs error: " fmt "\n", __VA_ARGS__)