Compare commits

...

16 Commits

Author SHA1 Message Date
Christopher Haster
80494b0bda Added thread-safe build+size reporting to CI 2020-11-28 12:41:36 -06:00
Christopher Haster
f507a5c483 Moved LFS_TRACE calls to API wrapper functions
This removes quite a bit of extra code needed to entertwine the
LFS_TRACE calls into the original funcions.

Also changed temporary return type to match API declaration where
necessary.
2020-11-28 12:37:01 -06:00
Christopher Haster
1c5081adb8 Tweaked thread-safe implementation
- Stayed on non-system include for lfs_util.h for now
- Named internal functions "lfs_functionraw"
- Merged lfs_fs_traverseraw
- Added LFS_LOCK/UNLOCK macros
- Changed LFS_THREADSAFE from 1/0 to defined/undefined to
  match LFS_READONLY
2020-11-28 11:15:23 -06:00
Bill Gesner
aab8df756f make the raw functions static 2020-11-20 20:34:54 +00:00
Bill Gesner
a15a060d90 make raw functions static. formatting tweaks 2020-11-20 17:01:04 +00:00
Bill Gesner
d46cefc71c review comments 2020-11-19 19:39:09 +00:00
Bill Gesner
3964e4e1c7 minor cleanup 2020-11-19 19:34:30 +00:00
Bill Gesner
def0228266 minor cleanup 2020-11-19 19:23:47 +00:00
Bill Gesner
1f831e234a address review comments 2020-11-19 19:17:42 +00:00
Bill Gesner
b477e0d8e8 use the global config file 2020-11-12 23:04:41 +00:00
Bill Gesner
be364e8721 fix ac6 linker issue 2020-11-09 16:07:40 +00:00
Bill Gesner
1ecef83c7a use global include 2020-11-06 20:12:15 +00:00
Bill Gesner
f195ffe74c fix locking issue in format and mount 2020-10-28 00:46:01 +00:00
Bill Gesner
16e48ca21b rename functions 2020-10-28 00:42:10 +00:00
Bill Gesner
b4ab86ee3a expand functions
add comment
2020-10-01 01:48:29 +00:00
Bill Gesner
10ac6b9cf0 add thread safe wrappers 2020-09-17 23:41:20 +00:00
3 changed files with 593 additions and 263 deletions

View File

@@ -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:

829
lfs.c

File diff suppressed because it is too large Load Diff

11
lfs.h
View File

@@ -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;