/littlefs-2.7.6/tests/ |
D | test_move.toml | 3 lfs_format(&lfs, &cfg) => 0; 4 lfs_mount(&lfs, &cfg) => 0; 5 lfs_mkdir(&lfs, "a") => 0; 6 lfs_mkdir(&lfs, "b") => 0; 7 lfs_mkdir(&lfs, "c") => 0; 8 lfs_mkdir(&lfs, "d") => 0; 9 lfs_file_open(&lfs, &file, "a/hello", LFS_O_CREAT | LFS_O_WRONLY) => 0; 10 lfs_file_write(&lfs, &file, "hola\n", 5) => 5; 11 lfs_file_write(&lfs, &file, "bonjour\n", 8) => 8; 12 lfs_file_write(&lfs, &file, "ohayo\n", 6) => 6; [all …]
|
D | test_entries.toml | 13 lfs_format(&lfs, &cfg) => 0; 14 lfs_mount(&lfs, &cfg) => 0; 18 lfs_file_open(&lfs, &file, path, 21 lfs_file_write(&lfs, &file, wbuffer, size) => size; 22 lfs_file_size(&lfs, &file) => size; 23 lfs_file_close(&lfs, &file) => 0; 26 lfs_file_open(&lfs, &file, path, 29 lfs_file_write(&lfs, &file, wbuffer, size) => size; 30 lfs_file_size(&lfs, &file) => size; 31 lfs_file_close(&lfs, &file) => 0; [all …]
|
D | test_dirs.toml | 3 lfs_format(&lfs, &cfg) => 0; 4 lfs_mount(&lfs, &cfg) => 0; 5 lfs_dir_open(&lfs, &dir, "/") => 0; 6 lfs_dir_read(&lfs, &dir, &info) => 1; 9 lfs_dir_read(&lfs, &dir, &info) => 1; 12 lfs_dir_read(&lfs, &dir, &info) => 0; 13 lfs_dir_close(&lfs, &dir) => 0; 14 lfs_unmount(&lfs) => 0; 20 lfs_format(&lfs, &cfg) => 0; 22 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_paths.toml | 4 lfs_format(&lfs, &cfg) => 0; 5 lfs_mount(&lfs, &cfg) => 0; 6 lfs_mkdir(&lfs, "tea") => 0; 7 lfs_mkdir(&lfs, "tea/hottea") => 0; 8 lfs_mkdir(&lfs, "tea/warmtea") => 0; 9 lfs_mkdir(&lfs, "tea/coldtea") => 0; 11 lfs_stat(&lfs, "tea/hottea", &info) => 0; 13 lfs_stat(&lfs, "/tea/hottea", &info) => 0; 16 lfs_mkdir(&lfs, "/milk") => 0; 17 lfs_stat(&lfs, "/milk", &info) => 0; [all …]
|
D | test_alloc.toml | 12 lfs_format(&lfs, &cfg) => 0; 13 lfs_mount(&lfs, &cfg) => 0; 14 lfs_mkdir(&lfs, "breakfast") => 0; 15 lfs_unmount(&lfs) => 0; 17 lfs_mount(&lfs, &cfg) => 0; 20 lfs_file_open(&lfs, &files[n], path, 26 lfs_file_write(&lfs, &files[n], names[n], size) => size; 30 lfs_file_close(&lfs, &files[n]) => 0; 32 lfs_unmount(&lfs) => 0; 34 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_seek.toml | 12 lfs_format(&lfs, &cfg) => 0; 13 lfs_mount(&lfs, &cfg) => 0; 14 lfs_file_open(&lfs, &file, "kitty", 19 lfs_file_write(&lfs, &file, buffer, size); 21 lfs_file_close(&lfs, &file) => 0; 22 lfs_unmount(&lfs) => 0; 24 lfs_mount(&lfs, &cfg) => 0; 25 lfs_file_open(&lfs, &file, "kitty", LFS_O_RDONLY) => 0; 30 lfs_file_read(&lfs, &file, buffer, size) => size; 32 pos = lfs_file_tell(&lfs, &file); [all …]
|
D | test_files.toml | 4 lfs_format(&lfs, &cfg) => 0; 5 lfs_mount(&lfs, &cfg) => 0; 6 lfs_file_open(&lfs, &file, "hello", 10 lfs_file_write(&lfs, &file, buffer, size) => size; 11 lfs_file_close(&lfs, &file) => 0; 12 lfs_unmount(&lfs) => 0; 14 lfs_mount(&lfs, &cfg) => 0; 15 lfs_file_open(&lfs, &file, "hello", LFS_O_RDONLY) => 0; 16 lfs_file_read(&lfs, &file, buffer, size) => size; 18 lfs_file_close(&lfs, &file) => 0; [all …]
|
D | test_attrs.toml | 3 lfs_format(&lfs, &cfg) => 0; 4 lfs_mount(&lfs, &cfg) => 0; 5 lfs_mkdir(&lfs, "hello") => 0; 6 lfs_file_open(&lfs, &file, "hello/hello", LFS_O_WRONLY | LFS_O_CREAT) => 0; 7 lfs_file_write(&lfs, &file, "hello", strlen("hello")) => strlen("hello"); 8 lfs_file_close(&lfs, &file); 9 lfs_unmount(&lfs) => 0; 11 lfs_mount(&lfs, &cfg) => 0; 13 lfs_setattr(&lfs, "hello", 'A', "aaaa", 4) => 0; 14 lfs_setattr(&lfs, "hello", 'B', "bbbbbb", 6) => 0; [all …]
|
D | test_truncate.toml | 5 lfs_format(&lfs, &cfg) => 0; 6 lfs_mount(&lfs, &cfg) => 0; 7 lfs_file_open(&lfs, &file, "baldynoop", 13 lfs_file_write(&lfs, &file, buffer, size) => size; 15 lfs_file_size(&lfs, &file) => LARGESIZE; 17 lfs_file_close(&lfs, &file) => 0; 18 lfs_unmount(&lfs) => 0; 20 lfs_mount(&lfs, &cfg) => 0; 21 lfs_file_open(&lfs, &file, "baldynoop", LFS_O_RDWR) => 0; 22 lfs_file_size(&lfs, &file) => LARGESIZE; [all …]
|
D | test_evil.toml | 9 in = "lfs.c" 12 lfs_format(&lfs, &cfg) => 0; 15 lfs_init(&lfs, &cfg) => 0; 17 lfs_dir_fetch(&lfs, &mdir, (lfs_block_t[2]){0, 1}) => 0; 18 lfs_dir_commit(&lfs, &mdir, LFS_MKATTRS( 23 lfs_deinit(&lfs) => 0; 26 lfs_mount(&lfs, &cfg) => LFS_ERR_CORRUPT; 31 in = "lfs.c" 34 lfs_format(&lfs, &cfg) => 0; 36 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_interspersed.toml | 8 lfs_format(&lfs, &cfg) => 0; 9 lfs_mount(&lfs, &cfg) => 0; 12 lfs_file_open(&lfs, &files[j], path, 18 lfs_file_write(&lfs, &files[j], &alphas[j], 1) => 1; 23 lfs_file_close(&lfs, &files[j]); 26 lfs_dir_open(&lfs, &dir, "/") => 0; 27 lfs_dir_read(&lfs, &dir, &info) => 1; 30 lfs_dir_read(&lfs, &dir, &info) => 1; 35 lfs_dir_read(&lfs, &dir, &info) => 1; 40 lfs_dir_read(&lfs, &dir, &info) => 0; [all …]
|
D | test_relocations.toml | 7 lfs_format(&lfs, &cfg) => 0; 9 lfs_mount(&lfs, &cfg) => 0; 10 lfs_file_open(&lfs, &file, "padding", LFS_O_CREAT | LFS_O_WRONLY) => 0; 12 while (LFS_BLOCK_COUNT - lfs_fs_size(&lfs) > 16) { 13 lfs_file_write(&lfs, &file, buffer, 512) => 512; 15 lfs_file_close(&lfs, &file) => 0; 17 lfs_mkdir(&lfs, "child") => 0; 18 lfs_unmount(&lfs) => 0; 20 lfs_mount(&lfs, &cfg) => 0; 24 lfs_file_open(&lfs, &file, path, LFS_O_CREAT | LFS_O_WRONLY) => 0; [all …]
|
D | test_superblocks.toml | 3 lfs_format(&lfs, &cfg) => 0; 8 lfs_format(&lfs, &cfg) => 0; 9 lfs_mount(&lfs, &cfg) => 0; 10 lfs_unmount(&lfs) => 0; 16 err = lfs_mount(&lfs, &cfg); 18 lfs_format(&lfs, &cfg) => 0; 19 lfs_mount(&lfs, &cfg) => 0; 21 lfs_unmount(&lfs) => 0; 26 lfs_mount(&lfs, &cfg) => LFS_ERR_CORRUPT; 33 lfs_format(&lfs, &cfg) => 0; [all …]
|
D | test_exhaustion.toml | 14 lfs_format(&lfs, &cfg) => 0; 15 lfs_mount(&lfs, &cfg) => 0; 16 lfs_mkdir(&lfs, "roadrunner") => 0; 17 lfs_unmount(&lfs) => 0; 21 lfs_mount(&lfs, &cfg) => 0; 28 lfs_file_open(&lfs, &file, path, 33 lfs_ssize_t res = lfs_file_write(&lfs, &file, &c, 1); 36 err = lfs_file_close(&lfs, &file); 38 lfs_unmount(&lfs) => 0; 43 err = lfs_file_close(&lfs, &file); [all …]
|
D | test_orphans.toml | 2 in = "lfs.c" 5 lfs_format(&lfs, &cfg) => 0; 6 lfs_mount(&lfs, &cfg) => 0; 7 lfs_mkdir(&lfs, "parent") => 0; 8 lfs_mkdir(&lfs, "parent/orphan") => 0; 9 lfs_mkdir(&lfs, "parent/child") => 0; 10 lfs_remove(&lfs, "parent/orphan") => 0; 11 lfs_unmount(&lfs) => 0; 16 lfs_mount(&lfs, &cfg) => 0; 17 lfs_dir_open(&lfs, &dir, "parent/child") => 0; [all …]
|
D | test_badblocks.toml | 22 lfs_format(&lfs, &cfg) => 0; 24 lfs_mount(&lfs, &cfg) => 0; 30 lfs_mkdir(&lfs, (char*)buffer) => 0; 37 lfs_file_open(&lfs, &file, (char*)buffer, 42 lfs_file_write(&lfs, &file, buffer, size) => size; 45 lfs_file_close(&lfs, &file) => 0; 47 lfs_unmount(&lfs) => 0; 49 lfs_mount(&lfs, &cfg) => 0; 55 lfs_stat(&lfs, (char*)buffer, &info) => 0; 63 lfs_file_open(&lfs, &file, (char*)buffer, LFS_O_RDONLY) => 0; [all …]
|
/littlefs-2.7.6/ |
D | lfs.c | 7 #include "lfs.h" 14 static inline void lfs_cache_drop(lfs_t *lfs, lfs_cache_t *rcache) { in lfs_cache_drop() argument 17 (void)lfs; in lfs_cache_drop() 21 static inline void lfs_cache_zero(lfs_t *lfs, lfs_cache_t *pcache) { in lfs_cache_zero() argument 23 memset(pcache->buffer, 0xff, lfs->cfg->cache_size); in lfs_cache_zero() 27 static int lfs_bd_read(lfs_t *lfs, in lfs_bd_read() argument 32 if (block >= lfs->cfg->block_count || in lfs_bd_read() 33 off+size > lfs->cfg->block_size) { in lfs_bd_read() 74 if (size >= hint && off % lfs->cfg->read_size == 0 && in lfs_bd_read() 75 size >= lfs->cfg->read_size) { in lfs_bd_read() [all …]
|
D | lfs.h | 364 typedef struct lfs { struct 409 int lfs_format(lfs_t *lfs, const struct lfs_config *config); argument 415 // lfs and config must be allocated while mounted. The config struct must 419 int lfs_mount(lfs_t *lfs, const struct lfs_config *config); 425 int lfs_unmount(lfs_t *lfs); 433 int lfs_remove(lfs_t *lfs, const char *path); 441 int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath); 447 int lfs_stat(lfs_t *lfs, const char *path, struct lfs_info *info); 461 lfs_ssize_t lfs_getattr(lfs_t *lfs, const char *path, 471 int lfs_setattr(lfs_t *lfs, const char *path, [all …]
|
D | README.md | 35 #include "lfs.h" 38 lfs_t lfs; 62 int err = lfs_mount(&lfs, &cfg); 67 lfs_format(&lfs, &cfg); 68 lfs_mount(&lfs, &cfg); 73 lfs_file_open(&lfs, &file, "boot_count", LFS_O_RDWR | LFS_O_CREAT); 74 lfs_file_read(&lfs, &file, &boot_count, sizeof(boot_count)); 78 lfs_file_rewind(&lfs, &file); 79 lfs_file_write(&lfs, &file, &boot_count, sizeof(boot_count)); 82 lfs_file_close(&lfs, &file); [all …]
|
D | .travis.yml | 65 OBJ="$(ls lfs*.c | sed 's/\.c/\.o/' | tr '\n' ' ')" 235 - littlefs-fuse/lfs --format /dev/loop0 236 - littlefs-fuse/lfs /dev/loop0 mount 273 - v1/lfs --format /dev/loop0 274 - v1/lfs /dev/loop0 mount 288 - v2/lfs --migrate /dev/loop0 289 - v2/lfs /dev/loop0 mount 306 # Find version defined in lfs.h 307 LFS_VERSION=$(grep -ox '#define LFS_VERSION .*' lfs.h | cut -d ' ' -f3) 335 ./scripts/prefix.py lfs$LFS_VERSION_MAJOR
|
D | Makefile | 1 TARGET = lfs.a 3 override TARGET = lfs 52 lfs: $(OBJ) target
|
D | .gitignore | 8 lfs
|
D | CMakeLists.txt | 8 lfs.c
|
D | lfs_util.c | 2 * lfs util functions
|
/littlefs-2.7.6/bd/ |
D | lfs_rambd.h | 10 #include "lfs.h"
|