mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-11-16 12:34:34 +00:00
Compare commits
1 Commits
devel
...
bump-defau
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab59ab7f8d |
@@ -267,11 +267,7 @@ License Identifiers that are here available: http://spdx.org/licenses/
|
||||
to create images of the filesystem on your PC. Check if littlefs will fit
|
||||
your needs, create images for a later download to the target memory or
|
||||
inspect the content of a binary image of the target memory.
|
||||
|
||||
- [littlefs-toy] - A command-line tool for creating and working with littlefs
|
||||
images. Uses syntax similar to tar command for ease of use. Supports working
|
||||
on littlefs images embedded inside another file (firmware image, etc).
|
||||
|
||||
|
||||
- [littlefs2-rust] - A Rust wrapper for littlefs. This project allows you
|
||||
to use littlefs in a Rust-friendly API, reaping the benefits of Rust's memory
|
||||
safety and other guarantees.
|
||||
@@ -325,7 +321,6 @@ License Identifiers that are here available: http://spdx.org/licenses/
|
||||
[littlefs-js]: https://github.com/geky/littlefs-js
|
||||
[littlefs-js-demo]:http://littlefs.geky.net/demo.html
|
||||
[littlefs-python]: https://pypi.org/project/littlefs-python/
|
||||
[littlefs-toy]: https://github.com/tjko/littlefs-toy
|
||||
[littlefs2-rust]: https://crates.io/crates/littlefs2
|
||||
[nim-littlefs]: https://github.com/Graveflo/nim-littlefs
|
||||
[chamelon]: https://github.com/yomimono/chamelon
|
||||
|
||||
10
lfs.c
10
lfs.c
@@ -93,7 +93,6 @@ static int lfs_bd_read(lfs_t *lfs,
|
||||
// bypass cache?
|
||||
diff = lfs_aligndown(diff, lfs->cfg->read_size);
|
||||
int err = lfs->cfg->read(lfs->cfg, block, off, data, diff);
|
||||
LFS_ASSERT(err <= 0);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
@@ -740,7 +739,6 @@ static lfs_stag_t lfs_dir_getslice(lfs_t *lfs, const lfs_mdir_t *dir,
|
||||
int err = lfs_bd_read(lfs,
|
||||
NULL, &lfs->rcache, sizeof(ntag),
|
||||
dir->pair[0], off, &ntag, sizeof(ntag));
|
||||
LFS_ASSERT(err <= 0);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
@@ -769,7 +767,6 @@ static lfs_stag_t lfs_dir_getslice(lfs_t *lfs, const lfs_mdir_t *dir,
|
||||
err = lfs_bd_read(lfs,
|
||||
NULL, &lfs->rcache, diff,
|
||||
dir->pair[0], off+sizeof(tag)+goff, gbuffer, diff);
|
||||
LFS_ASSERT(err <= 0);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
@@ -1282,7 +1279,6 @@ static lfs_stag_t lfs_dir_fetchmatch(lfs_t *lfs,
|
||||
if (err == LFS_ERR_CORRUPT) {
|
||||
break;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
lfs_fcrc_fromle32(&fcrc);
|
||||
@@ -2268,7 +2264,7 @@ static int lfs_dir_relocatingcommit(lfs_t *lfs, lfs_mdir_t *dir,
|
||||
}
|
||||
}
|
||||
|
||||
if (dir->erased && dir->count < 0xff) {
|
||||
if (dir->erased) {
|
||||
// try to commit
|
||||
struct lfs_commit commit = {
|
||||
.block = dir->pair[0],
|
||||
@@ -4335,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;
|
||||
@@ -4346,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
|
||||
|
||||
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