mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 08:48:31 +01:00
Compare commits
1 Commits
fix-null-f
...
debug-allo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69b34644bd |
14
lfs.c
14
lfs.c
@@ -466,9 +466,15 @@ static int lfs_alloc(lfs_t *lfs, lfs_block_t *block) {
|
||||
}
|
||||
}
|
||||
|
||||
// no free blocks in lookahead buffer, need to scan tree
|
||||
LFS_DEBUG("Scanning for free blocks %"PRIx32"-%"PRIx32,
|
||||
lfs->free.i + lfs->free.off,
|
||||
(lfs->free.i + lfs->free.off + 8*lfs->cfg->lookahead_size)
|
||||
% lfs->cfg->block_count);
|
||||
|
||||
// check if we have looked at all blocks since last ack
|
||||
if (lfs->free.ack == 0) {
|
||||
LFS_ERROR("No more free space %"PRIu32,
|
||||
LFS_ERROR("No more free space %"PRIx32,
|
||||
lfs->free.i + lfs->free.off);
|
||||
return LFS_ERR_NOSPC;
|
||||
}
|
||||
@@ -975,10 +981,9 @@ static lfs_stag_t lfs_dir_fetchmatch(lfs_t *lfs,
|
||||
|
||||
static int lfs_dir_fetch(lfs_t *lfs,
|
||||
lfs_mdir_t *dir, const lfs_block_t pair[2]) {
|
||||
// note, mask=-1, tag=-1 can never match a tag since this
|
||||
// note, mask=-1, tag=0 can never match a tag since this
|
||||
// pattern has the invalid bit set
|
||||
return (int)lfs_dir_fetchmatch(lfs, dir, pair,
|
||||
(lfs_tag_t)-1, (lfs_tag_t)-1, NULL, NULL, NULL);
|
||||
return (int)lfs_dir_fetchmatch(lfs, dir, pair, -1, 0, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static int lfs_dir_getgstate(lfs_t *lfs, const lfs_mdir_t *dir,
|
||||
@@ -1644,6 +1649,7 @@ relocate:
|
||||
if (err && (err != LFS_ERR_NOSPC && !exhausted)) {
|
||||
return err;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user