/littlefs-2.7.6/bd/ |
D | lfs_testbd.c | 13 int lfs_testbd_createcfg(const struct lfs_config *cfg, const char *path, in lfs_testbd_createcfg() argument 23 (void*)cfg, cfg->context, in lfs_testbd_createcfg() 24 (void*)(uintptr_t)cfg->read, (void*)(uintptr_t)cfg->prog, in lfs_testbd_createcfg() 25 (void*)(uintptr_t)cfg->erase, (void*)(uintptr_t)cfg->sync, in lfs_testbd_createcfg() 26 cfg->read_size, cfg->prog_size, cfg->block_size, cfg->block_count, in lfs_testbd_createcfg() 30 lfs_testbd_t *bd = cfg->context; in lfs_testbd_createcfg() 31 bd->cfg = bdcfg; in lfs_testbd_createcfg() 35 bd->power_cycles = bd->cfg->power_cycles; in lfs_testbd_createcfg() 37 if (bd->cfg->erase_cycles) { in lfs_testbd_createcfg() 38 if (bd->cfg->wear_buffer) { in lfs_testbd_createcfg() [all …]
|
D | lfs_rambd.c | 9 int lfs_rambd_createcfg(const struct lfs_config *cfg, in lfs_rambd_createcfg() argument 16 (void*)cfg, cfg->context, in lfs_rambd_createcfg() 17 (void*)(uintptr_t)cfg->read, (void*)(uintptr_t)cfg->prog, in lfs_rambd_createcfg() 18 (void*)(uintptr_t)cfg->erase, (void*)(uintptr_t)cfg->sync, in lfs_rambd_createcfg() 19 cfg->read_size, cfg->prog_size, cfg->block_size, cfg->block_count, in lfs_rambd_createcfg() 21 lfs_rambd_t *bd = cfg->context; in lfs_rambd_createcfg() 22 bd->cfg = bdcfg; in lfs_rambd_createcfg() 25 if (bd->cfg->buffer) { in lfs_rambd_createcfg() 26 bd->buffer = bd->cfg->buffer; in lfs_rambd_createcfg() 28 bd->buffer = lfs_malloc(cfg->block_size * cfg->block_count); in lfs_rambd_createcfg() [all …]
|
D | lfs_filebd.c | 13 int lfs_filebd_createcfg(const struct lfs_config *cfg, const char *path, in lfs_filebd_createcfg() argument 21 (void*)cfg, cfg->context, in lfs_filebd_createcfg() 22 (void*)(uintptr_t)cfg->read, (void*)(uintptr_t)cfg->prog, in lfs_filebd_createcfg() 23 (void*)(uintptr_t)cfg->erase, (void*)(uintptr_t)cfg->sync, in lfs_filebd_createcfg() 24 cfg->read_size, cfg->prog_size, cfg->block_size, cfg->block_count, in lfs_filebd_createcfg() 26 lfs_filebd_t *bd = cfg->context; in lfs_filebd_createcfg() 27 bd->cfg = bdcfg; in lfs_filebd_createcfg() 41 int lfs_filebd_create(const struct lfs_config *cfg, const char *path) { in lfs_filebd_create() argument 47 (void*)cfg, cfg->context, in lfs_filebd_create() 48 (void*)(uintptr_t)cfg->read, (void*)(uintptr_t)cfg->prog, in lfs_filebd_create() [all …]
|
D | lfs_testbd.h | 77 struct lfs_filebd_config cfg; member 81 struct lfs_rambd_config cfg; member 89 const struct lfs_testbd_config *cfg; member 99 int lfs_testbd_create(const struct lfs_config *cfg, const char *path); 100 int lfs_testbd_createcfg(const struct lfs_config *cfg, const char *path, 104 int lfs_testbd_destroy(const struct lfs_config *cfg); 107 int lfs_testbd_read(const struct lfs_config *cfg, lfs_block_t block, 113 int lfs_testbd_prog(const struct lfs_config *cfg, lfs_block_t block, 120 int lfs_testbd_erase(const struct lfs_config *cfg, lfs_block_t block); 123 int lfs_testbd_sync(const struct lfs_config *cfg); [all …]
|
D | lfs_rambd.h | 39 const struct lfs_rambd_config *cfg; member 44 int lfs_rambd_create(const struct lfs_config *cfg); 45 int lfs_rambd_createcfg(const struct lfs_config *cfg, 49 int lfs_rambd_destroy(const struct lfs_config *cfg); 52 int lfs_rambd_read(const struct lfs_config *cfg, lfs_block_t block, 58 int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, 65 int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block); 68 int lfs_rambd_sync(const struct lfs_config *cfg);
|
D | lfs_filebd.h | 37 const struct lfs_filebd_config *cfg; member 42 int lfs_filebd_create(const struct lfs_config *cfg, const char *path); 43 int lfs_filebd_createcfg(const struct lfs_config *cfg, const char *path, 47 int lfs_filebd_destroy(const struct lfs_config *cfg); 50 int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, 56 int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, 63 int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block); 66 int lfs_filebd_sync(const struct lfs_config *cfg);
|
/littlefs-2.7.6/tests/ |
D | test_alloc.toml | 12 lfs_format(&lfs, &cfg) => 0; 13 lfs_mount(&lfs, &cfg) => 0; 17 lfs_mount(&lfs, &cfg) => 0; 34 lfs_mount(&lfs, &cfg) => 0; 54 lfs_format(&lfs, &cfg) => 0; 55 lfs_mount(&lfs, &cfg) => 0; 60 lfs_mount(&lfs, &cfg) => 0; 73 lfs_mount(&lfs, &cfg) => 0; 95 lfs_format(&lfs, &cfg) => 0; 98 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_evil.toml | 12 lfs_format(&lfs, &cfg) => 0; 15 lfs_init(&lfs, &cfg) => 0; 26 lfs_mount(&lfs, &cfg) => LFS_ERR_CORRUPT; 34 lfs_format(&lfs, &cfg) => 0; 36 lfs_mount(&lfs, &cfg) => 0; 41 lfs_init(&lfs, &cfg) => 0; 60 lfs_mount(&lfs, &cfg) => 0; 80 lfs_format(&lfs, &cfg) => 0; 82 lfs_mount(&lfs, &cfg) => 0; 89 lfs_init(&lfs, &cfg) => 0; [all …]
|
D | test_move.toml | 3 lfs_format(&lfs, &cfg) => 0; 4 lfs_mount(&lfs, &cfg) => 0; 16 lfs_mount(&lfs, &cfg) => 0; 20 lfs_mount(&lfs, &cfg) => 0; 60 lfs_format(&lfs, &cfg) => 0; 61 lfs_mount(&lfs, &cfg) => 0; 77 lfs_format(&lfs, &cfg) => 0; 78 lfs_mount(&lfs, &cfg) => 0; 90 lfs_mount(&lfs, &cfg) => 0; 95 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_superblocks.toml | 3 lfs_format(&lfs, &cfg) => 0; 8 lfs_format(&lfs, &cfg) => 0; 9 lfs_mount(&lfs, &cfg) => 0; 16 err = lfs_mount(&lfs, &cfg); 18 lfs_format(&lfs, &cfg) => 0; 19 lfs_mount(&lfs, &cfg) => 0; 26 lfs_mount(&lfs, &cfg) => LFS_ERR_CORRUPT; 33 lfs_format(&lfs, &cfg) => 0; 34 lfs_mount(&lfs, &cfg) => 0; 47 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_orphans.toml | 5 lfs_format(&lfs, &cfg) => 0; 6 lfs_mount(&lfs, &cfg) => 0; 16 lfs_mount(&lfs, &cfg) => 0; 22 cfg.read(&cfg, block, 0, bbuffer, LFS_BLOCK_SIZE) => 0; 28 cfg.erase(&cfg, block) => 0; 29 cfg.prog(&cfg, block, 0, bbuffer, LFS_BLOCK_SIZE) => 0; 30 cfg.sync(&cfg) => 0; 32 lfs_mount(&lfs, &cfg) => 0; 38 lfs_mount(&lfs, &cfg) => 0; 51 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_dirs.toml | 3 lfs_format(&lfs, &cfg) => 0; 4 lfs_mount(&lfs, &cfg) => 0; 20 lfs_format(&lfs, &cfg) => 0; 22 lfs_mount(&lfs, &cfg) => 0; 29 lfs_mount(&lfs, &cfg) => 0; 51 lfs_format(&lfs, &cfg) => 0; 53 lfs_mount(&lfs, &cfg) => 0; 60 lfs_mount(&lfs, &cfg) => 0; 78 lfs_mount(&lfs, &cfg) => 0; 85 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_paths.toml | 4 lfs_format(&lfs, &cfg) => 0; 5 lfs_mount(&lfs, &cfg) => 0; 26 lfs_format(&lfs, &cfg) => 0; 27 lfs_mount(&lfs, &cfg) => 0; 50 lfs_format(&lfs, &cfg) => 0; 51 lfs_mount(&lfs, &cfg) => 0; 76 lfs_format(&lfs, &cfg) => 0; 77 lfs_mount(&lfs, &cfg) => 0; 106 lfs_format(&lfs, &cfg) => 0; 107 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_files.toml | 4 lfs_format(&lfs, &cfg) => 0; 5 lfs_mount(&lfs, &cfg) => 0; 14 lfs_mount(&lfs, &cfg) => 0; 26 lfs_format(&lfs, &cfg) => 0; 29 lfs_mount(&lfs, &cfg) => 0; 44 lfs_mount(&lfs, &cfg) => 0; 65 lfs_format(&lfs, &cfg) => 0; 68 lfs_mount(&lfs, &cfg) => 0; 83 lfs_mount(&lfs, &cfg) => 0; 99 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_badblocks.toml | 19 lfs_testbd_setwear(&cfg, badblock-1, 0) => 0; 20 lfs_testbd_setwear(&cfg, badblock, 0xffffffff) => 0; 22 lfs_format(&lfs, &cfg) => 0; 24 lfs_mount(&lfs, &cfg) => 0; 49 lfs_mount(&lfs, &cfg) => 0; 93 lfs_testbd_setwear(&cfg, i+2, 0xffffffff) => 0; 96 lfs_format(&lfs, &cfg) => 0; 98 lfs_mount(&lfs, &cfg) => 0; 123 lfs_mount(&lfs, &cfg) => 0; 166 lfs_testbd_setwear(&cfg, (2*i) + 2, 0xffffffff) => 0; [all …]
|
D | test_truncate.toml | 5 lfs_format(&lfs, &cfg) => 0; 6 lfs_mount(&lfs, &cfg) => 0; 20 lfs_mount(&lfs, &cfg) => 0; 30 lfs_mount(&lfs, &cfg) => 0; 49 lfs_format(&lfs, &cfg) => 0; 50 lfs_mount(&lfs, &cfg) => 0; 64 lfs_mount(&lfs, &cfg) => 0; 81 lfs_mount(&lfs, &cfg) => 0; 98 lfs_format(&lfs, &cfg) => 0; 99 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_exhaustion.toml | 14 lfs_format(&lfs, &cfg) => 0; 15 lfs_mount(&lfs, &cfg) => 0; 21 lfs_mount(&lfs, &cfg) => 0; 74 lfs_mount(&lfs, &cfg) => 0; 99 lfs_format(&lfs, &cfg) => 0; 103 lfs_mount(&lfs, &cfg) => 0; 156 lfs_mount(&lfs, &cfg) => 0; 183 lfs_testbd_setwear(&cfg, b, 187 lfs_format(&lfs, &cfg) => 0; 188 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_attrs.toml | 3 lfs_format(&lfs, &cfg) => 0; 4 lfs_mount(&lfs, &cfg) => 0; 11 lfs_mount(&lfs, &cfg) => 0; 63 lfs_mount(&lfs, &cfg) => 0; 81 lfs_format(&lfs, &cfg) => 0; 82 lfs_mount(&lfs, &cfg) => 0; 89 lfs_mount(&lfs, &cfg) => 0; 140 lfs_mount(&lfs, &cfg) => 0; 158 lfs_format(&lfs, &cfg) => 0; 159 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_seek.toml | 12 lfs_format(&lfs, &cfg) => 0; 13 lfs_mount(&lfs, &cfg) => 0; 24 lfs_mount(&lfs, &cfg) => 0; 81 lfs_format(&lfs, &cfg) => 0; 82 lfs_mount(&lfs, &cfg) => 0; 93 lfs_mount(&lfs, &cfg) => 0; 136 lfs_format(&lfs, &cfg) => 0; 137 lfs_mount(&lfs, &cfg) => 0; 148 lfs_mount(&lfs, &cfg) => 0; 196 lfs_format(&lfs, &cfg) => 0; [all …]
|
D | test_relocations.toml | 7 lfs_format(&lfs, &cfg) => 0; 9 lfs_mount(&lfs, &cfg) => 0; 20 lfs_mount(&lfs, &cfg) => 0; 50 lfs_mount(&lfs, &cfg) => 0; 73 lfs_format(&lfs, &cfg) => 0; 75 lfs_mount(&lfs, &cfg) => 0; 86 lfs_mount(&lfs, &cfg) => 0; 158 err = lfs_mount(&lfs, &cfg); 160 lfs_format(&lfs, &cfg) => 0; 161 lfs_mount(&lfs, &cfg) => 0; [all …]
|
D | test_interspersed.toml | 8 lfs_format(&lfs, &cfg) => 0; 9 lfs_mount(&lfs, &cfg) => 0; 67 lfs_format(&lfs, &cfg) => 0; 68 lfs_mount(&lfs, &cfg) => 0; 80 lfs_mount(&lfs, &cfg) => 0; 118 lfs_format(&lfs, &cfg) => 0; 119 lfs_mount(&lfs, &cfg) => 0; 183 err = lfs_mount(&lfs, &cfg); 185 lfs_format(&lfs, &cfg) => 0; 186 lfs_mount(&lfs, &cfg) => 0;
|
D | test_entries.toml | 13 lfs_format(&lfs, &cfg) => 0; 14 lfs_mount(&lfs, &cfg) => 0; 102 lfs_format(&lfs, &cfg) => 0; 103 lfs_mount(&lfs, &cfg) => 0; 191 lfs_format(&lfs, &cfg) => 0; 192 lfs_mount(&lfs, &cfg) => 0; 264 lfs_format(&lfs, &cfg) => 0; 265 lfs_mount(&lfs, &cfg) => 0; 353 lfs_format(&lfs, &cfg) => 0; 354 lfs_mount(&lfs, &cfg) => 0; [all …]
|
/littlefs-2.7.6/ |
D | lfs.c | 23 memset(pcache->buffer, 0xff, lfs->cfg->cache_size); in lfs_cache_zero() 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() 77 diff = lfs_aligndown(diff, lfs->cfg->read_size); in lfs_bd_read() 78 int err = lfs->cfg->read(lfs->cfg, block, off, data, diff); in lfs_bd_read() 90 LFS_ASSERT(block < lfs->cfg->block_count); in lfs_bd_read() 92 rcache->off = lfs_aligndown(off, lfs->cfg->read_size); in lfs_bd_read() 95 lfs_alignup(off+hint, lfs->cfg->read_size), in lfs_bd_read() [all …]
|
D | lfs.h | 346 const struct lfs_file_config *cfg; member 389 const struct lfs_config *cfg; member 647 int lfs_migrate(lfs_t *lfs, const struct lfs_config *cfg);
|
D | README.md | 42 const struct lfs_config cfg = { 62 int err = lfs_mount(&lfs, &cfg); 67 lfs_format(&lfs, &cfg); 68 lfs_mount(&lfs, &cfg);
|