Home
last modified time | relevance | path

Searched +full:- +full:1 (Results 1 – 25 of 30) sorted by relevance

12

/littlefs-2.7.6/
Dlfs.c5 * SPDX-License-Identifier: BSD-3-Clause
10 #define LFS_BLOCK_NULL ((lfs_block_t)-1)
11 #define LFS_BLOCK_INLINE ((lfs_block_t)-2)
18 rcache->block = LFS_BLOCK_NULL; in lfs_cache_drop()
23 memset(pcache->buffer, 0xff, lfs->cfg->cache_size); in lfs_cache_zero()
24 pcache->block = LFS_BLOCK_NULL; 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()
40 if (pcache && block == pcache->block && in lfs_bd_read()
41 off < pcache->off + pcache->size) { in lfs_bd_read()
[all …]
DSPEC.md10 | | | .---._____
11 .-----. | |
12 --|o |---| littlefs |
13 --| |---| |
14 '-----' '----------'
20 - littlefs is a block-based filesystem. The disk is divided into an array of
23 - Block pointers are stored in 32 bits, with the special value `0xffffffff`
26 - In addition to the logical block size (which usually matches the erase
31 - By default, all values in littlefs are stored in little-endian byte order.
49 The high-level layout of a metadata block is fairly simple:
[all …]
DDESIGN.md3 A little fail-safe filesystem designed for microcontrollers.
6 | | | .---._____
7 .-----. | |
8 --|o |---| littlefs |
9 --| |---| |
10 '-----' '----------'
16 filesystem that is resilient to power-loss and flash wear without using
19 This document covers the high-level design of littlefs, how it is different
21 low-level details covering every bit on disk, check out [SPEC.md](SPEC.md).
25 The embedded systems littlefs targets are usually 32-bit microcontrollers with
[all …]
D.travis.yml4 - CFLAGS=-Werror
5 - MAKEFLAGS=-j
11 - $HOME/.cache/apt
14 _: &install-common
16 - sudo apt-get install python3 python3-pip
17 - sudo pip3 install toml
18 # setup a ram-backed disk to speed up reentrant tests
19 - mkdir disks
20 - sudo mount -t tmpfs -o size=100m tmpfs disks
21 - export TFLAGS="$TFLAGS --disk=disks/disk"
[all …]
Dlfs_util.h5 * SPDX-License-Identifier: BSD-3-Clause
11 // LFS_CONFIG as a header file to include (-DLFS_CONFIG=lfs_config.h).
65 // macros must not have side-effects as the macros can be removed for a smaller
130 // toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more
133 // Min/max functions for unsigned 32-bit numbers
144 return a - (a % alignment); in lfs_aligndown()
148 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()
[all …]
Dlfs.h5 * SPDX-License-Identifier: BSD-3-Clause
22 // Major (top-nibble), incremented on backwards incompatible changes
23 // Minor (bottom-nibble), incremented on feature additions
28 // Version of On-disk data structures
29 // Major (top-nibble), incremented on backwards incompatible changes
30 // Minor (bottom-nibble), incremented on feature additions
73 LFS_ERR_IO = -5, // Error during device operation
74 LFS_ERR_CORRUPT = -84, // Corrupted
75 LFS_ERR_NOENT = -2, // No directory entry
76 LFS_ERR_EXIST = -17, // Entry already exists
[all …]
/littlefs-2.7.6/scripts/
Dtest.py27 ./scripts/explode_asserts.py $$< -o $$@
31 -include tests/*.d
35 $(CC) $(CFLAGS) $^ $(LFLAGS) -o $@
50 'LFS_BLOCK_CYCLES': -1,
175 len(self.filter) >= 1 and
180 self.filter[1] != self.permno):
217 print('truncate --size=0', disk)
223 # simulate power-loss after n cycles?
231 ncmd.extend(['-ex', 'r'])
233 ncmd.extend(['-ex', 'up 2'])
[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:
182 while len(block) - off >= 4:
[all …]
Dreadtree.py35 blocks[id(data[-1])] = block
106 struct.unpack('<HH', superblock[1].data[0:4].ljust(4, b'\xff'))))
107 print("%-47s%s" % ("littlefs v%s.%s" % version,
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,
130 ' -> {%#x, %#x}' % struct.unpack('<II', mdir.tail.data)
144 ' ' if j == len(dir)-1 else
145 'v' if k == len(lines)-1 else
151 errcode = errcode or 1
[all …]
Dexplode_asserts.py188 'op': ['strcmp', 'memcmp', '->'],
226 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])
377 parser.add_argument('-o', '--output', required=True,
379 parser.add_argument('-p', '--pattern', action='append',
381 parser.add_argument('--maxwidth', default=MAXWIDTH, type=int,
Dprefix.py24 name, count3 = re.subn('\\B-D'+from_prefix.upper(),
25 '-D'+to_prefix.upper(), name)
34 'git', 'ls-tree', '-r', '--name-only', 'HEAD']).split()
56 '%s -> %s' % (oldname, newname) if namecount else oldname,
61 sys.exit(main(*sys.argv[1:]))
/littlefs-2.7.6/tests/
Dtest_evil.toml6 [[case]] # invalid tail-pointer test
14 // change tail-pointer to invalid pointers
17 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
[all …]
Dtest_relocations.toml5 define.LFS_BLOCK_CYCLES = [8, 1]
12 while (LFS_BLOCK_COUNT - lfs_fs_size(&lfs) > 16) {
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]
[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_files.toml8 size = strlen("Hello World!")+1;
24 define.CHUNKSIZE = [31, 16, 33, 1, 1023]
32 srand(1);
34 lfs_size_t chunk = lfs_min(CHUNKSIZE, SIZE-i);
47 srand(1);
49 lfs_size_t chunk = lfs_min(CHUNKSIZE, SIZE-i);
63 define.CHUNKSIZE = [31, 16, 1]
71 srand(1);
73 lfs_size_t chunk = lfs_min(CHUNKSIZE, SIZE1-i);
86 srand(1);
[all …]
Dtest_orphans.toml14 // to the linked-list entry, which should orphan the orphan. Note this
23 int off = LFS_BLOCK_SIZE-1;
25 off -= 1;
27 memset(&bbuffer[off-3], LFS_BLOCK_SIZE, 3);
61 # TODO fix this case, caused by non-DAG trees
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);
[all …]
Dtest_seek.toml8 {COUNT=4, SKIP=1},
27 lfs_soff_t pos = -1;
56 lfs_file_seek(&lfs, &file, -size, LFS_SEEK_CUR) => pos;
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;
229 lfs_file_seek(&lfs, &file, -((COUNT+SKIP)*size),
231 lfs_file_tell(&lfs, &file) => (COUNT+1)*size;
233 lfs_file_seek(&lfs, &file, -((COUNT+2*SKIP)*size),
[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;
106 memset(&bbuffer[off-3], LFS_BLOCK_SIZE, 3);
113 lfs_dir_read(&lfs, &dir, &info) => 1;
116 lfs_dir_read(&lfs, &dir, &info) => 1;
[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_alloc.toml3 if = 'LFS_BLOCK_CYCLES == -1'
7 define.SIZE = '(((LFS_BLOCK_SIZE-8)*(LFS_BLOCK_COUNT-6)) / FILES)'
50 define.SIZE = '(((LFS_BLOCK_SIZE-8)*(LFS_BLOCK_COUNT-6)) / FILES)'
89 define.SIZE = '(((LFS_BLOCK_SIZE-8)*(LFS_BLOCK_COUNT-6)) / FILES)'
90 define.CYCLES = [1, 10]
144 define.SIZE = '(((LFS_BLOCK_SIZE-8)*(LFS_BLOCK_COUNT-6)) / FILES)'
145 define.CYCLES = [1, 10]
230 define.SIZE = '(((LFS_BLOCK_SIZE-8)*(LFS_BLOCK_COUNT-4)) / 3)'
294 count += 1;
315 for (int i = 0; i < count+1; i++) {
[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_superblocks.toml30 define.LFS_BLOCK_CYCLES = [32, 33, 1]
46 // one last check after power-cycle
58 define.LFS_BLOCK_CYCLES = [32, 33, 1]
82 // one last check after power-cycle
91 define.LFS_BLOCK_CYCLES = [2, 1]
121 // one last check after power-cycle
/littlefs-2.7.6/bd/
Dlfs_filebd.c5 * SPDX-License-Identifier: BSD-3-Clause
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()
25 path, (void*)bdcfg, bdcfg->erase_value); in lfs_filebd_createcfg()
26 lfs_filebd_t *bd = cfg->context; in lfs_filebd_createcfg()
27 bd->cfg = bdcfg; in lfs_filebd_createcfg()
30 bd->fd = open(path, O_RDWR | O_CREAT, 0666); in lfs_filebd_createcfg()
31 if (bd->fd < 0) { in lfs_filebd_createcfg()
[all …]
Dlfs_rambd.c5 * SPDX-License-Identifier: BSD-3-Clause
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()
20 (void*)bdcfg, bdcfg->erase_value, bdcfg->buffer); 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()
[all …]
Dlfs_testbd.c6 * SPDX-License-Identifier: BSD-3-Clause
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()
27 path, (void*)bdcfg, bdcfg->erase_value, bdcfg->erase_cycles, in lfs_testbd_createcfg()
28 bdcfg->badblock_behavior, bdcfg->power_cycles, in lfs_testbd_createcfg()
29 bdcfg->buffer, bdcfg->wear_buffer); in lfs_testbd_createcfg()
30 lfs_testbd_t *bd = cfg->context; in lfs_testbd_createcfg()
31 bd->cfg = bdcfg; in lfs_testbd_createcfg()
[all …]

12