forked from Imagelibrary/littlefs
Compare commits
7 Commits
fix-make-b
...
bump-defau
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab59ab7f8d | ||
|
|
8e251dd675 | ||
|
|
25b9a4af85 | ||
|
|
2acf939a00 | ||
|
|
d5a86fd28d | ||
|
|
2349ac8c96 | ||
|
|
0755b00c21 |
11
lfs.c
11
lfs.c
@@ -828,9 +828,6 @@ static int lfs_dir_getread(lfs_t *lfs, const lfs_mdir_t *dir,
|
||||
size -= diff;
|
||||
continue;
|
||||
}
|
||||
|
||||
// rcache takes priority
|
||||
diff = lfs_min(diff, rcache->off-off);
|
||||
}
|
||||
|
||||
// load to cache, first condition can no longer fail
|
||||
@@ -4334,7 +4331,7 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
|
||||
LFS_ASSERT(lfs->cfg->inline_max == (lfs_size_t)-1
|
||||
|| lfs->cfg->inline_max <= ((lfs->cfg->metadata_max)
|
||||
? lfs->cfg->metadata_max
|
||||
: lfs->cfg->block_size)/8);
|
||||
: lfs->cfg->block_size)/4);
|
||||
lfs->inline_max = lfs->cfg->inline_max;
|
||||
if (lfs->inline_max == (lfs_size_t)-1) {
|
||||
lfs->inline_max = 0;
|
||||
@@ -4345,7 +4342,7 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
|
||||
lfs->attr_max,
|
||||
((lfs->cfg->metadata_max)
|
||||
? lfs->cfg->metadata_max
|
||||
: lfs->cfg->block_size)/8));
|
||||
: lfs->cfg->block_size)/4));
|
||||
}
|
||||
|
||||
// setup default state
|
||||
@@ -5225,7 +5222,9 @@ static int lfs_fs_gc_(lfs_t *lfs) {
|
||||
}
|
||||
|
||||
// try to populate the lookahead buffer, unless it's already full
|
||||
if (lfs->lookahead.size < 8*lfs->cfg->lookahead_size) {
|
||||
if (lfs->lookahead.size < lfs_min(
|
||||
8 * lfs->cfg->lookahead_size,
|
||||
lfs->block_count)) {
|
||||
err = lfs_alloc_scan(lfs);
|
||||
if (err) {
|
||||
return err;
|
||||
|
||||
2
lfs.h
2
lfs.h
@@ -277,7 +277,7 @@ struct lfs_config {
|
||||
// Optional upper limit on inlined files in bytes. Inlined files live in
|
||||
// metadata and decrease storage requirements, but may be limited to
|
||||
// improve metadata-related performance. Must be <= cache_size, <=
|
||||
// attr_max, and <= block_size/8. Defaults to the largest possible
|
||||
// attr_max, and <= block_size/4. Defaults to the largest possible
|
||||
// inline_max when zero.
|
||||
//
|
||||
// Set to -1 to disable inlined files.
|
||||
|
||||
Reference in New Issue
Block a user