mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 00:38:29 +01:00
Compare commits
16 Commits
fix-assert
...
thread-saf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80494b0bda | ||
|
|
f507a5c483 | ||
|
|
1c5081adb8 | ||
|
|
aab8df756f | ||
|
|
a15a060d90 | ||
|
|
d46cefc71c | ||
|
|
3964e4e1c7 | ||
|
|
def0228266 | ||
|
|
1f831e234a | ||
|
|
b477e0d8e8 | ||
|
|
be364e8721 | ||
|
|
1ecef83c7a | ||
|
|
f195ffe74c | ||
|
|
16e48ca21b | ||
|
|
b4ab86ee3a | ||
|
|
10ac6b9cf0 |
16
.travis.yml
16
.travis.yml
@@ -208,6 +208,22 @@ jobs:
|
||||
script:
|
||||
- make test TFLAGS+="-k --valgrind"
|
||||
|
||||
# test compilation in thread-safe mode
|
||||
- stage: test
|
||||
env:
|
||||
- NAME=littlefs-threadsafe
|
||||
- CC="arm-linux-gnueabi-gcc --static -mthumb"
|
||||
- CFLAGS="-Werror -DLFS_THREADSAFE"
|
||||
if: branch !~ -prefix$
|
||||
install:
|
||||
- *install-common
|
||||
- sudo apt-get install
|
||||
gcc-arm-linux-gnueabi
|
||||
libc6-dev-armel-cross
|
||||
- arm-linux-gnueabi-gcc --version
|
||||
# report-size will compile littlefs and report the size
|
||||
script: [*report-size]
|
||||
|
||||
# self-host with littlefs-fuse for fuzz test
|
||||
- stage: test
|
||||
env:
|
||||
|
||||
@@ -207,7 +207,7 @@ int lfs_testbd_prog(const struct lfs_config *cfg, lfs_block_t block,
|
||||
bd->power_cycles -= 1;
|
||||
if (bd->power_cycles == 0) {
|
||||
// sync to make sure we persist the last changes
|
||||
LFS_ASSERT(lfs_testbd_rawsync(cfg) == 0);
|
||||
assert(lfs_testbd_rawsync(cfg) == 0);
|
||||
// simulate power loss
|
||||
exit(33);
|
||||
}
|
||||
@@ -254,7 +254,7 @@ int lfs_testbd_erase(const struct lfs_config *cfg, lfs_block_t block) {
|
||||
bd->power_cycles -= 1;
|
||||
if (bd->power_cycles == 0) {
|
||||
// sync to make sure we persist the last changes
|
||||
LFS_ASSERT(lfs_testbd_rawsync(cfg) == 0);
|
||||
assert(lfs_testbd_rawsync(cfg) == 0);
|
||||
// simulate power loss
|
||||
exit(33);
|
||||
}
|
||||
|
||||
11
lfs.h
11
lfs.h
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "lfs_util.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
@@ -174,6 +175,16 @@ struct lfs_config {
|
||||
// are propogated to the user.
|
||||
int (*sync)(const struct lfs_config *c);
|
||||
|
||||
#ifdef LFS_THREADSAFE
|
||||
// Lock the underlying block device. Negative error codes
|
||||
// are propogated to the user.
|
||||
int (*lock)(const struct lfs_config *c);
|
||||
|
||||
// Unlock the underlying block device. Negative error codes
|
||||
// are propogated to the user.
|
||||
int (*unlock)(const struct lfs_config *c);
|
||||
#endif
|
||||
|
||||
// Minimum size of a block read. All read operations will be a
|
||||
// multiple of this value.
|
||||
lfs_size_t read_size;
|
||||
|
||||
Reference in New Issue
Block a user