Home
last modified time | relevance | path

Searched refs:lfs (Results 1 – 21 of 21) sorted by relevance

/littlefs-3.5.0-3.4.0/tests/
Dtest_move.toml3 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 …]
Dtest_dirs.toml3 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 …]
Dtest_entries.toml13 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 …]
Dtest_paths.toml4 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 …]
Dtest_attrs.toml3 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 …]
Dtest_seek.toml12 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 …]
Dtest_truncate.toml5 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 …]
Dtest_alloc.toml12 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 …]
Dtest_files.toml4 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 …]
Dtest_evil.toml9 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 …]
Dtest_interspersed.toml8 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 …]
Dtest_relocations.toml7 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 …]
Dtest_superblocks.toml3 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 …]
Dtest_exhaustion.toml14 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 …]
Dtest_orphans.toml2 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 …]
Dtest_badblocks.toml22 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-3.5.0-3.4.0/
Dlfs.c35 static inline void lfs_cache_drop(lfs_t *lfs, lfs_cache_t *rcache) { in lfs_cache_drop() argument
38 (void)lfs; in lfs_cache_drop()
42 static inline void lfs_cache_zero(lfs_t *lfs, lfs_cache_t *pcache) { in lfs_cache_zero() argument
44 memset(pcache->buffer, 0xff, lfs->cfg->cache_size); in lfs_cache_zero()
48 static int lfs_bd_read(lfs_t *lfs, in lfs_bd_read() argument
53 if (block >= lfs->cfg->block_count || in lfs_bd_read()
54 off+size > lfs->cfg->block_size) { in lfs_bd_read()
95 if (size >= hint && off % lfs->cfg->read_size == 0 && in lfs_bd_read()
96 size >= lfs->cfg->read_size) { in lfs_bd_read()
98 diff = lfs_aligndown(diff, lfs->cfg->read_size); in lfs_bd_read()
[all …]
Dlfs.h387 typedef struct lfs { struct
433 int lfs_format(lfs_t *lfs, const struct lfs_config *config); argument
444 int lfs_mount(lfs_t *lfs, const struct lfs_config *config);
450 int lfs_unmount(lfs_t *lfs);
459 int lfs_remove(lfs_t *lfs, const char *path);
469 int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath);
476 int lfs_stat(lfs_t *lfs, const char *path, struct lfs_info *info);
490 lfs_ssize_t lfs_getattr(lfs_t *lfs, const char *path,
501 int lfs_setattr(lfs_t *lfs, const char *path,
511 int lfs_removeattr(lfs_t *lfs, const char *path, uint8_t type);
[all …]
DMakefile14 TARGET ?= $(BUILDDIR)lfs
16 TARGET ?= $(BUILDDIR)lfs.a
127 summary: $(BUILDDIR)lfs.csv
135 $(BUILDDIR)lfs: $(OBJ)
138 $(BUILDDIR)lfs.a: $(OBJ)
141 $(BUILDDIR)lfs.csv: $(OBJ) $(CGI)
166 rm -f $(BUILDDIR)lfs
167 rm -f $(BUILDDIR)lfs.a
168 rm -f $(BUILDDIR)lfs.csv
DREADME.md35 #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.gitignore10 lfs