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
path: root/lfs.h
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2017-11-10 04:10:08 +0300
committerChristopher Haster <chaster@utexas.edu>2017-11-10 19:53:30 +0300
commitf4aeb8331a5e0d8c5d476d738f47066d399735ce (patch)
tree879e8dbd0837da041bb12b3f538fec735fc6c024 /lfs.h
parentdb51a395bab7f32479c4a4f09bb44f19eec014a1 (diff)
Fixed issue with aggressively rounding down lookahead configuration
The littlefs allows buffers to be passed statically in the case that a system does not have a heap. Unfortunately, this means we can't round up in the case of an unaligned lookahead buffer. Double unfortunately, rounding down after clamping to the block device size could result in a lookahead of zero for block devices < 32 blocks large. The assert in littlefs does catch this case, but rounding down prevents support for < 32 block devices. The solution is to simply require a 32-bit aligned buffer with an assert. This avoids runtime problems while allowing a user to pass in the correct buffer for < 32 block devices. Rounding up can be handled at higher API levels.
Diffstat (limited to 'lfs.h')
-rw-r--r--lfs.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/lfs.h b/lfs.h
index 270a65e..e4aab0e 100644
--- a/lfs.h
+++ b/lfs.h
@@ -236,7 +236,6 @@ typedef struct lfs_superblock {
} lfs_superblock_t;
typedef struct lfs_free {
- lfs_size_t lookahead;
lfs_block_t begin;
lfs_block_t end;
lfs_block_t off;