Home
last modified time | relevance | path

Searched full:1 (Results 1 – 25 of 33) sorted by relevance

12

/littlefs-2.7.6/tests/
Dtest_interspersed.toml18 lfs_file_write(&lfs, &files[j], &alphas[j], 1) => 1;
27 lfs_dir_read(&lfs, &dir, &info) => 1;
30 lfs_dir_read(&lfs, &dir, &info) => 1;
35 lfs_dir_read(&lfs, &dir, &info) => 1;
50 lfs_file_read(&lfs, &files[j], buffer, 1) => 1;
74 lfs_file_write(&lfs, &file, &alphas[j], 1) => 1;
83 lfs_file_write(&lfs, &file, (const void*)"~", 1) => 1;
92 lfs_dir_read(&lfs, &dir, &info) => 1;
95 lfs_dir_read(&lfs, &dir, &info) => 1;
98 lfs_dir_read(&lfs, &dir, &info) => 1;
[all …]
Dtest_move.toml22 lfs_dir_read(&lfs, &dir, &info) => 1;
25 lfs_dir_read(&lfs, &dir, &info) => 1;
31 lfs_dir_read(&lfs, &dir, &info) => 1;
34 lfs_dir_read(&lfs, &dir, &info) => 1;
37 lfs_dir_read(&lfs, &dir, &info) => 1;
102 int off = LFS_BLOCK_SIZE-1;
104 off -= 1;
113 lfs_dir_read(&lfs, &dir, &info) => 1;
116 lfs_dir_read(&lfs, &dir, &info) => 1;
122 lfs_dir_read(&lfs, &dir, &info) => 1;
[all …]
Dtest_dirs.toml6 lfs_dir_read(&lfs, &dir, &info) => 1;
9 lfs_dir_read(&lfs, &dir, &info) => 1;
31 lfs_dir_read(&lfs, &dir, &info) => 1;
34 lfs_dir_read(&lfs, &dir, &info) => 1;
39 lfs_dir_read(&lfs, &dir, &info) => 1;
62 lfs_dir_read(&lfs, &dir, &info) => 1;
65 lfs_dir_read(&lfs, &dir, &info) => 1;
70 lfs_dir_read(&lfs, &dir, &info) => 1;
87 lfs_dir_read(&lfs, &dir, &info) => 1;
90 lfs_dir_read(&lfs, &dir, &info) => 1;
[all …]
Dtest_relocations.toml5 define.LFS_BLOCK_CYCLES = [8, 1]
29 lfs_dir_read(&lfs, &dir, &info) => 1;
30 lfs_dir_read(&lfs, &dir, &info) => 1;
33 lfs_dir_read(&lfs, &dir, &info) => 1;
39 if (j == ITERATIONS-1) {
52 lfs_dir_read(&lfs, &dir, &info) => 1;
53 lfs_dir_read(&lfs, &dir, &info) => 1;
56 lfs_dir_read(&lfs, &dir, &info) => 1;
71 define.LFS_BLOCK_CYCLES = [8, 1]
95 lfs_dir_read(&lfs, &dir, &info) => 1;
[all …]
Dtest_badblocks.toml2 if = 'LFS_BLOCK_CYCLES == -1'
7 define.LFS_ERASE_VALUE = [0x00, 0xff, -1]
16 define.FILEMULT = 1
19 lfs_testbd_setwear(&cfg, badblock-1, 0) => 0;
25 for (int i = 1; i < 10; i++) {
34 buffer[j+NAMEMULT+1] = '0'+i;
36 buffer[2*NAMEMULT+1] = '\0';
50 for (int i = 1; i < 10; i++) {
60 buffer[j+NAMEMULT+1] = '0'+i;
62 buffer[2*NAMEMULT+1] = '\0';
[all …]
Dtest_exhaustion.toml26 size = 1 << ((rand() % 10)+2);
33 lfs_ssize_t res = lfs_file_write(&lfs, &file, &c, 1);
34 assert(res == 1 || res == LFS_ERR_NOSPC);
55 size = 1 << ((rand() % 10)+2);
61 lfs_file_read(&lfs, &file, &r, 1) => 1;
69 cycle += 1;
108 size = 1 << ((rand() % 10)+2);
115 lfs_ssize_t res = lfs_file_write(&lfs, &file, &c, 1);
116 assert(res == 1 || res == LFS_ERR_NOSPC);
137 size = 1 << ((rand() % 10)+2);
[all …]
Dtest_evil.toml17 lfs_dir_fetch(&lfs, &mdir, (lfs_block_t[2]){0, 1}) => 0;
43 lfs_dir_fetch(&lfs, &mdir, (lfs_block_t[2]){0, 1}) => 0;
44 // make sure id 1 == our directory
47 LFS_MKTAG(LFS_TYPE_NAME, 1, strlen("dir_here")), buffer)
48 => LFS_MKTAG(LFS_TYPE_DIR, 1, strlen("dir_here"));
52 {LFS_MKTAG(LFS_TYPE_DIRSTRUCT, 1, 8),
91 lfs_dir_fetch(&lfs, &mdir, (lfs_block_t[2]){0, 1}) => 0;
92 // make sure id 1 == our file
95 LFS_MKTAG(LFS_TYPE_NAME, 1, strlen("file_here")), buffer)
96 => LFS_MKTAG(LFS_TYPE_REG, 1, strlen("file_here"));
[all …]
Dtest_seek.toml8 {COUNT=4, SKIP=1},
27 lfs_soff_t pos = -1;
60 lfs_file_seek(&lfs, &file, -size, LFS_SEEK_END) >= 0 => 1;
77 {COUNT=4, SKIP=1},
96 lfs_soff_t pos = -1;
121 lfs_file_seek(&lfs, &file, -size, LFS_SEEK_END) >= 0 => 1;
231 lfs_file_tell(&lfs, &file) => (COUNT+1)*size;
235 lfs_file_tell(&lfs, &file) => (COUNT+1)*size;
253 lfs_file_write(&lfs, &file, &buffer[j++ % 26], 1) => 1;
254 lfs_file_tell(&lfs, &file) => i+1;
[all …]
Dtest_files.toml8 size = strlen("Hello World!")+1;
24 define.CHUNKSIZE = [31, 16, 33, 1, 1023]
32 srand(1);
47 srand(1);
63 define.CHUNKSIZE = [31, 16, 1]
71 srand(1);
86 srand(1);
125 srand(1);
145 define.CHUNKSIZE = [31, 16, 1]
153 srand(1);
[all …]
Dtest_orphans.toml23 int off = LFS_BLOCK_SIZE-1;
25 off -= 1;
64 {FILES=6, DEPTH=1, CYCLES=20},
65 {FILES=26, DEPTH=1, CYCLES=20},
75 srand(1);
99 assert(strcmp(info.name, &path[2*d+1]) == 0);
104 assert(strcmp(info.name, &full_path[2*(DEPTH-1)+1]) == 0);
108 for (int d = DEPTH-1; d >= 0; d--) {
Dtest_attrs.toml55 lfs_setattr(&lfs, "hello", 'A', buffer, LFS_ATTR_MAX+1) => LFS_ERR_NOSPC;
133 lfs_setattr(&lfs, "/", 'A', buffer, LFS_ATTR_MAX+1) => LFS_ERR_NOSPC;
187 attrs1[1].size = 0;
191 attrs1[1].size = 6;
198 attrs1[1].size = 6;
203 attrs1[1].size = 6;
210 attrs1[1].size = 3;
215 attrs1[1].size = 6;
222 attrs1[0].size = LFS_ATTR_MAX+1;
Dtest_alloc.toml3 if = 'LFS_BLOCK_CYCLES == -1'
90 define.CYCLES = [1, 10]
145 define.CYCLES = [1, 10]
294 count += 1;
315 for (int i = 0; i < count+1; i++) {
438 count += 1;
452 for (int i = 0; i < count+1; i++) {
555 i < ((cfg.block_count-2+1)/2)*(cfg.block_size-8);
586 i < ((cfg.block_count-2+1)/2)*(cfg.block_size-8);
620 i < ((cfg.block_count-2+1)/2)*(cfg.block_size-8);
[all …]
Dtest_superblocks.toml30 define.LFS_BLOCK_CYCLES = [32, 33, 1]
58 define.LFS_BLOCK_CYCLES = [32, 33, 1]
91 define.LFS_BLOCK_CYCLES = [2, 1]
/littlefs-2.7.6/
Dlfs.c10 #define LFS_BLOCK_NULL ((lfs_block_t)-1)
112 LFS_CMP_LT = 1,
126 block, off+i, &dat, 1); in lfs_bd_cmp()
244 pair[0] = pair[1]; in lfs_pair_swap()
245 pair[1] = t; in lfs_pair_swap()
249 return pair[0] == LFS_BLOCK_NULL || pair[1] == LFS_BLOCK_NULL; in lfs_pair_isnull()
255 return !(paira[0] == pairb[0] || paira[1] == pairb[1] || in lfs_pair_cmp()
256 paira[0] == pairb[1] || paira[1] == pairb[0]); in lfs_pair_cmp()
262 return (paira[0] == pairb[0] && paira[1] == pairb[1]) || in lfs_pair_sync()
263 (paira[0] == pairb[1] && paira[1] == pairb[0]); in lfs_pair_sync()
[all …]
DSPEC.md56 | | | +-- 1st commit
93 1. **Revision count (32-bits)** - Incremented every erase cycle. If both blocks
153 | | | | +-- 1st commit
205 [1|-- 11 --|-- 10 --|-- 10 --]
230 1. **Valid bit (1-bit)** - Indicates if the tag is valid.
292 [1| 3| 8 | 10 | 10 ][--- (size * 8) ---]
302 1. **file type (8-bits)** - Type of the file.
333 across a linked-list of metadata pairs rooted on the blocks 0 and 1. The last
362 [1|- 11 -| 10 | 10 ][--- 64 ---]
370 [1|- 11 -| 10 | 10 ][-- 32 --|-- 32 --|-- 32 --]
[all …]
Dlfs_util.h148 return lfs_aligndown(a + alignment-1, alignment); in lfs_alignup()
154 return 32 - __builtin_clz(a-1); in lfs_npw2()
158 a -= 1; in lfs_npw2()
162 s = (a > 0x3 ) << 1; a >>= s; r |= s; in lfs_npw2()
163 return (r | (a >> 1)) + 1; in lfs_npw2()
173 return lfs_npw2((a & -a) + 1) - 1; in lfs_ctz()
182 a = a - ((a >> 1) & 0x55555555); in lfs_popc()
208 (((uint8_t*)&a)[1] << 8) | in lfs_fromle32()
232 (((uint8_t*)&a)[1] << 16) | in lfs_frombe32()
DDESIGN.md34 relatively cheap and can be very granular. Erasing however (setting bits to 1),
46 1. **Power-loss resilience** - On these systems, power can be lost at any time.
51 1. **Wear leveling** - Writing to flash is destructive. If a filesystem
56 1. **Bounded RAM/ROM** - If the above requirements weren't enough, these
75 1. First we have the non-resilient, block based filesystems, such as [FAT] and
135 1. _O(n&sup2;)_ runtime
242 complexity is _O(1)_ by bounding the input.
324 metadata pair pointer: {block 0, block 1}
330 | | |block 0 | |block 1 | |
337 block 1 is |----------------|----------------|
[all …]
D.travis.yml39 # NOR flash: read/prog = 1 block = 4KiB
40 - make test TFLAGS+="-nrk -DLFS_READ_SIZE=1 -DLFS_BLOCK_SIZE=4096"
53 - make test TFLAGS+="-nrk -DLFS_READ_SIZE=1 -DLFS_CACHE_SIZE=1"
55 - make test TFLAGS+="-nrk -DLFS_BLOCK_CYCLES=1"
72 CURR=$(tail -n1 sizes | awk '{print $1}')
219 - git clone --depth 1 https://github.com/geky/littlefs-fuse -b v2
254 - git clone --depth 1 https://github.com/geky/littlefs-fuse -b v2 v2
255 - git clone --depth 1 https://github.com/geky/littlefs-fuse -b v1 v1
314 | sed -n '/^Link/{s/.*<\(.*\)>; rel="last"/\1/;p;q0};$q1' \
318 .captures[].string | tonumber) | max + 1' \
[all …]
/littlefs-2.7.6/scripts/
Dreadtree.py35 blocks[id(data[-1])] = block
106 struct.unpack('<HH', superblock[1].data[0:4].ljust(4, b'\xff'))))
116 print(" orphans >=%d" % max(tag.size, 1))
119 blocks[0], blocks[1], tag.id))
128 mdir.blocks[0], mdir.blocks[1], mdir.rev, mdir.pair[1].rev,
144 ' ' if j == len(dir)-1 else
145 'v' if k == len(lines)-1 else
151 errcode = errcode or 1
153 mdir.blocks[0], mdir.blocks[1]))
158 cycle[0], cycle[1]))
[all …]
Dreadmdir.py31 if len(args) == 1:
35 type = TAG_TYPES[args[0]][1]
39 if isinstance(args[1], str):
40 id = int(args[1], 0) if args[1] not in 'x.' else 0x3ff
42 id = args[1]
102 return (self.type & TAG_TYPES[type][0]) == TAG_TYPES[type][1]
123 mask = 0x7ff & ~((1 << prefix)-1)
128 type, prefix//4, self.type & ((1 << prefix)-1))
157 if len(blocks) > 1:
206 tag = Tag(int(tag) ^ ((tag.type & 1) << 31))
[all …]
Dtest.py50 'LFS_BLOCK_CYCLES': -1,
175 len(self.filter) >= 1 and
180 self.filter[1] != self.permno):
251 mpty = os.fdopen(mpty, 'r', 1)
267 '^{0}([^:]+):(\d+):(?:\d+:)?{0}{1}:{0}(.*)$'
272 with open(m.group(1)) as f:
274 line = (next(it.islice(f, lineno-1, None))
277 'path': m.group(1),
284 raise TestFailure(self, 1, stdout, None)
303 uninit = (self.defines.get('LFS_ERASE_VALUE', None) == -1)
[all …]
Dexplode_asserts.py226 if token[0] in pattern or token[1] in pattern:
227 self.m = token[1]
235 self.off += 1
355 outf.write("#line %d \"%s\"\n" % (1, args.input))
369 outf.write(p.tokens[i][1])
/littlefs-2.7.6/bd/
Dlfs_filebd.c52 static const struct lfs_filebd_config defaults = {.erase_value=-1}; in lfs_filebd_create()
84 if (bd->cfg->erase_value != -1) { in lfs_filebd_read()
120 if (bd->cfg->erase_value != -1) { in lfs_filebd_prog()
131 ssize_t res2 = read(bd->fd, &c, 1); in lfs_filebd_prog()
170 if (bd->cfg->erase_value != -1) { in lfs_filebd_erase()
179 ssize_t res2 = write(bd->fd, &(uint8_t){bd->cfg->erase_value}, 1); in lfs_filebd_erase()
Dlfs_rambd.c36 if (bd->cfg->erase_value != -1) { in lfs_rambd_createcfg()
54 static const struct lfs_rambd_config defaults = {.erase_value=-1}; in lfs_rambd_create()
103 if (bd->cfg->erase_value != -1) { in lfs_rambd_prog()
125 if (bd->cfg->erase_value != -1) { in lfs_rambd_erase()
Dlfs_testbd.c81 static const struct lfs_testbd_config defaults = {.erase_value=-1}; in lfs_testbd_create()
207 bd->power_cycles -= 1; in lfs_testbd_prog()
241 bd->wear[block] += 1; in lfs_testbd_erase()
254 bd->power_cycles -= 1; in lfs_testbd_erase()

12