/littlefs-3.5.0-3.4.0/ |
D | lfs_util.h | 108 static inline uint32_t lfs_max(uint32_t a, uint32_t b) { in lfs_max() argument 109 return (a > b) ? a : b; in lfs_max() 112 static inline uint32_t lfs_min(uint32_t a, uint32_t b) { in lfs_min() argument 113 return (a < b) ? a : b; in lfs_min() 117 static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) { in lfs_aligndown() argument 118 return a - (a % alignment); in lfs_aligndown() 121 static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) { in lfs_alignup() argument 122 return lfs_aligndown(a + alignment-1, alignment); in lfs_alignup() 126 static inline uint32_t lfs_npw2(uint32_t a) { in lfs_npw2() argument 128 return 32 - __builtin_clz(a-1); in lfs_npw2() [all …]
|
D | DESIGN.md | 15 in the context of microcontrollers. The question was: How would you build a 40 reactive, with no concept of a shutdown routine. This presents a big challenge 42 leave a device unrecoverable. 47 If a power loss corrupts any persistent data structures, this can cause the 49 recover from a power loss during any write operation. 51 1. **Wear leveling** - Writing to flash is destructive. If a filesystem 54 used to store frequently updated metadata and cause a device's early death. 62 were possible. For RAM we have a stronger requirement, all RAM usage is 64 size or number of files. This creates a unique challenge as even presumably 72 power-loss resilience and wear leveling, we can narrow these down to a handful [all …]
|
D | SPEC.md | 20 - littlefs is a block-based filesystem. The disk is divided into an array of 24 representing a null block address. 27 block size), littlefs also uses a program block size and read block size. 35 Metadata pairs form the backbone of littlefs and provide a system for 36 distributed atomic updates. Even the superblock is stored in a metadata pair. 38 As their name suggests, a metadata pair is stored in two blocks, with one block 39 providing a backup during erase cycles in case power is lost. These two blocks 40 are not necessarily sequential and may be anywhere on disk, so a "pointer" to a 43 On top of this, each metadata block behaves as an appendable log, containing a 49 The high-level layout of a metadata block is fairly simple: [all …]
|
D | README.md | 22 **Bounded RAM/ROM** - littlefs is designed to work with a small amount of 30 Here's a simple example that updates a file named `boot_count` every time 97 littlefs takes in a configuration structure that defines how the filesystem 105 simultaneously. With the `lfs_t` and configuration struct, a user can 106 format a block device or mount the filesystem. 108 Once mounted, the littlefs provides a full set of POSIX-like file and 121 All littlefs calls have the potential to return a negative error code. The 126 user may return a `LFS_ERR_CORRUPT` error if the implementation already can 139 At a high level, littlefs is a block based filesystem that uses small logs to 142 In littlefs, these ingredients form a sort of two-layered cake, with the small [all …]
|
D | Makefile | 16 TARGET ?= $(BUILDDIR)lfs.a 138 $(BUILDDIR)lfs.a: $(OBJ) 167 rm -f $(BUILDDIR)lfs.a
|
D | lfs.c | 372 static inline void lfs_gstate_xor(lfs_gstate_t *a, const lfs_gstate_t *b) { in lfs_gstate_xor() argument 374 ((uint32_t*)a)[i] ^= ((const uint32_t*)b)[i]; in lfs_gstate_xor() 378 static inline bool lfs_gstate_iszero(const lfs_gstate_t *a) { in lfs_gstate_iszero() argument 380 if (((uint32_t*)a)[i] != 0) { in lfs_gstate_iszero() 388 static inline bool lfs_gstate_hasorphans(const lfs_gstate_t *a) { in lfs_gstate_hasorphans() argument 389 return lfs_tag_size(a->tag); in lfs_gstate_hasorphans() 392 static inline uint8_t lfs_gstate_getorphans(const lfs_gstate_t *a) { in lfs_gstate_getorphans() argument 393 return lfs_tag_size(a->tag); in lfs_gstate_getorphans() 396 static inline bool lfs_gstate_hasmove(const lfs_gstate_t *a) { in lfs_gstate_hasmove() argument 397 return lfs_tag_type1(a->tag); in lfs_gstate_hasmove() [all …]
|
D | .gitignore | 4 *.a
|
/littlefs-3.5.0-3.4.0/tests/ |
D | test_move.toml | 5 lfs_mkdir(&lfs, "a") => 0; 9 lfs_file_open(&lfs, &file, "a/hello", LFS_O_CREAT | LFS_O_WRONLY) => 0; 17 lfs_rename(&lfs, "a/hello", "c/hello") => 0; 21 lfs_dir_open(&lfs, &dir, "a") => 0; 44 lfs_file_open(&lfs, &file, "a/hello", LFS_O_RDONLY) => LFS_ERR_NOENT; 79 lfs_mkdir(&lfs, "a") => 0; 83 lfs_file_open(&lfs, &file, "a/hello", LFS_O_CREAT | LFS_O_WRONLY) => 0; 91 lfs_rename(&lfs, "a/hello", "c/hello") => 0; 96 lfs_dir_open(&lfs, &dir, "a") => 0; 112 lfs_dir_open(&lfs, &dir, "a") => 0; [all …]
|
D | test_exhaustion.toml | 1 [[case]] # test running a filesystem to exhaustion 32 char c = 'a' + (rand() % 26); 59 char c = 'a' + (rand() % 26); 85 [[case]] # test running a filesystem to exhaustion 114 char c = 'a' + (rand() % 26); 141 char c = 'a' + (rand() % 26); 167 # These are a sort of high-level litmus test for wear-leveling. One definition 168 # of wear-leveling is that increasing a block device's space translates directly 172 [[case]] # wear-level test running a filesystem to exhaustion 205 char c = 'a' + (rand() % 26); [all …]
|
D | test_evil.toml | 35 // make a dir 58 // test that accessing our bad dir fails, note there's a number 81 // make a file 104 // test that accessing our bad file fails, note there's a number 129 // make a file 165 // test that accessing our bad file fails, note there's a number
|
D | test_alloc.toml | 2 # note for these to work there are a number constraints on the device geometry 326 [[case]] # what if we have a bad block during an allocation scan? 347 // now fill all but a couple of blocks of the filesystem with data 363 // but mark the head of our file as a "bad block", this is force our 464 // shorten file to try a second chained dir 493 // create one block hole for half a directory 630 // rewrite one file with a hole of one block 643 // try to allocate a directory, should fail!
|
D | test_orphans.toml | 15 // makes a lot of assumptions about the remove operation. 42 // this mkdir should both create a dir and deorphan, so size
|
D | test_relocations.toml | 16 // make a child dir to use in bounded space 82 // make a child dir to use in bounded space 148 # almost every tree operation needs a relocation
|
/littlefs-3.5.0-3.4.0/scripts/ |
D | summary.py | 51 lambda rs: ft.reduce(lambda a, b: (a[0]+b[0], a[1]+b[1]), rs),
|
D | readtree.py | 59 gstate = bytes((a or 0) ^ (b or 0) 60 for a,b in it.zip_longest(gstate, ngstate.data))
|
D | test.py | 822 directory of tests, a specific file, a suite by name, and even \ 855 a path to a *.info file to accumulate coverage info into.")
|
D | data.py | 249 or a list of paths. Defaults to %r." % OBJ_PATHS)
|
D | code.py | 250 or a list of paths. Defaults to %r." % OBJ_PATHS)
|
D | structs.py | 301 or a list of paths. Defaults to %r." % OBJ_PATHS)
|
D | stack.py | 395 or a list of paths. Defaults to %r." % CI_PATHS)
|