Home
last modified time | relevance | path

Searched refs:size (Results 1 – 25 of 42) sorted by relevance

12

/littlefs-3.7.0-3.6.0/tests/
Dtest_entries.toml19 lfs_size_t size;
20 sprintf(path, "hi0"); size = 20;
24 memset(wbuffer, 'c', size);
25 lfs_file_write(&lfs, &file, wbuffer, size) => size;
26 lfs_file_size(&lfs, &file) => size;
29 sprintf(path, "hi1"); size = 20;
32 memset(wbuffer, 'c', size);
33 lfs_file_write(&lfs, &file, wbuffer, size) => size;
34 lfs_file_size(&lfs, &file) => size;
37 sprintf(path, "hi2"); size = 20;
[all …]
Dtest_seek.toml19 size_t size = strlen("kittycatcat");
21 memcpy(buffer, "kittycatcat", size);
23 lfs_file_write(&lfs, &file, buffer, size);
32 size = strlen("kittycatcat");
34 lfs_file_read(&lfs, &file, buffer, size) => size;
35 memcmp(buffer, "kittycatcat", size) => 0;
41 lfs_file_read(&lfs, &file, buffer, size) => size;
42 memcmp(buffer, "kittycatcat", size) => 0;
45 lfs_file_read(&lfs, &file, buffer, size) => size;
46 memcmp(buffer, "kittycatcat", size) => 0;
[all …]
Dtest_truncate.toml16 size_t size = strlen((char*)buffer);
17 for (lfs_off_t j = 0; j < LARGESIZE; j += size) {
18 lfs_file_write(&lfs, &file, buffer, lfs_min(size, LARGESIZE-j))
19 => lfs_min(size, LARGESIZE-j);
40 size = strlen("hair");
41 for (lfs_off_t j = 0; j < MEDIUMSIZE; j += size) {
42 lfs_file_read(&lfs, &file, buffer, lfs_min(size, MEDIUMSIZE-j))
43 => lfs_min(size, MEDIUMSIZE-j);
44 memcmp(buffer, "hair", lfs_min(size, MEDIUMSIZE-j)) => 0;
46 lfs_file_read(&lfs, &file, buffer, size) => 0;
[all …]
Dtest_alloc.toml31 size_t size = strlen(names[n]);
32 for (lfs_size_t i = 0; i < SIZE; i += size) {
33 lfs_file_write(&lfs, &files[n], names[n], size) => size;
47 size_t size = strlen(names[n]);
48 for (lfs_size_t i = 0; i < SIZE; i += size) {
50 lfs_file_read(&lfs, &file, buffer, size) => size;
51 assert(memcmp(buffer, names[n], size) == 0);
79 size_t size = strlen(names[n]);
81 memcpy(buffer, names[n], size);
82 for (int i = 0; i < SIZE; i += size) {
[all …]
Dtest_powerloss.toml18 lfs_size_t size = strlen("hello");
20 lfs_file_write(&lfs, &file, buffer, size) => size;
28 lfs_file_read(&lfs, &file, rbuffer, size) => size;
29 assert(memcmp(rbuffer, buffer, size) == 0);
57 lfs_file_read(&lfs, &file, rbuffer, size) => size;
58 assert(memcmp(rbuffer, buffer, size) == 0);
66 size = strlen("goodbye");
68 lfs_file_write(&lfs, &file, buffer, size) => size;
75 size = strlen("hello");
77 lfs_file_read(&lfs, &file, rbuffer, size) => size;
[all …]
Dtest_badblocks.toml43 lfs_size_t size = NAMEMULT;
45 lfs_file_write(&lfs, &file, buffer, size) => size;
71 int size = NAMEMULT;
74 lfs_file_read(&lfs, &file, rbuffer, size) => size;
75 memcmp(buffer, rbuffer, size) => 0;
123 lfs_size_t size = NAMEMULT;
125 lfs_file_write(&lfs, &file, buffer, size) => size;
151 lfs_size_t size = NAMEMULT;
154 lfs_file_read(&lfs, &file, rbuffer, size) => size;
155 memcmp(buffer, rbuffer, size) => 0;
[all …]
Dtest_files.toml10 lfs_size_t size = strlen("Hello World!")+1;
13 lfs_file_write(&lfs, &file, buffer, size) => size;
19 lfs_file_read(&lfs, &file, buffer, size) => size;
320 // can only be 0 (new file) or full size
321 lfs_size_t size = lfs_file_size(&lfs, &file);
322 assert(size == 0 || size == SIZE);
377 // with syncs we could be any size, but it at least must be valid data
378 lfs_size_t size = lfs_file_size(&lfs, &file);
379 assert(size <= SIZE);
381 for (lfs_size_t i = 0; i < size; i += CHUNKSIZE) {
[all …]
Dtest_exhaustion.toml25 // chose name, roughly random seed, and random 2^n size
29 lfs_size_t size = 1 << ((TEST_PRNG(&prng) % 10)+2);
35 for (lfs_size_t j = 0; j < size; j++) {
60 lfs_size_t size = 1 << ((TEST_PRNG(&prng) % 10)+2);
64 for (lfs_size_t j = 0; j < size; j++) {
115 // chose name, roughly random seed, and random 2^n size
119 lfs_size_t size = 1 << ((TEST_PRNG(&prng) % 10)+2);
125 for (lfs_size_t j = 0; j < size; j++) {
150 lfs_size_t size = 1 << ((TEST_PRNG(&prng) % 10)+2);
154 for (lfs_size_t j = 0; j < size; j++) {
[all …]
Dtest_move.toml44 assert(info.size == 5+8+6);
142 assert(info.size == 5+8+6);
230 assert(info.size == 5+8+6);
340 assert(info.size == 5+8+6);
385 assert(info.size == 5+8+6 || info.size == 0);
391 assert(info.size == 5+8+6);
397 assert(info.size == 5+8+6);
403 assert(info.size == 5+8+6);
410 if (lfs_stat(&lfs, "a/hello", &info) == 0 && info.size > 0) {
455 assert(info.size == 5+8+6);
[all …]
Dtest_interspersed.toml43 assert(info.size == SIZE);
115 assert(info.size == FILES);
171 assert(info.size == SIZE);
175 assert(info.size == SIZE);
218 lfs_ssize_t size = lfs_file_size(&lfs, &files[j]);
219 assert(size >= 0);
220 if ((int)size <= i) {
246 assert(info.size == SIZE);
Dtest_attrs.toml196 attrs1[1].size = 0;
200 attrs1[1].size = 6;
207 attrs1[1].size = 6;
212 attrs1[1].size = 6;
219 attrs1[1].size = 3;
224 attrs1[1].size = 6;
231 attrs1[0].size = LFS_ATTR_MAX+1;
244 attrs1[0].size = 4;
/littlefs-3.7.0-3.6.0/scripts/
Dtracebd.py343 size=1, argument
355 self.size = size
360 def _op(self, f, block=None, off=None, size=None): argument
365 off, size = 0, self.size
366 elif size is None:
367 off, size = 0, off
371 size=max(self.size, off+size),
375 start = (block*self.size + off) / (self.size*self.count)
376 stop = (block*self.size + off+size) / (self.size*self.count)
386 def read(self, block=None, off=None, size=None): argument
[all …]
Dreadmdir.py47 size = int(args[2], str) if args[2] not in 'x.' else 0x3ff
49 size = args[2]
51 self.tag = (type << 20) | (id << 10) | size
88 def size(self): member in Tag
93 return 4 + (self.size if self.size != 0x3ff else 0)
122 ntag = Tag(self.type, nid, self.size)
155 return repr(self.size) if self.size != 0x3ff else 'x'
158 return 'Tag(%r, %d, %d)' % (self.typerepr(), self.id, self.size)
299 if tag.size == 0x3ff:
356 if mdir.tail.size != 8 or mdir.tail.data == 8*b'\xff':
Dprettyasserts.py189 def mkassert(type, cmp, lh, rh, size=None): argument
190 if size is not None:
192 % (type.upper(), cmp.upper(), lh, rh, size))
270 size = p_expr(p) ; p.accept('ws')
275 return mkassert('mem', CMP[cmp], lh, rh, size)
361 size = p_expr(p) ; p.accept('ws')
365 return ws + mkassert('mem', 'eq', lh, rh, size)
Dperfbd.py189 size = int(m.group('size'), 16)
191 if not size:
196 syms[name].add((addr, size))
197 sym_at.append((addr, name, size))
209 for addr, name, size in sym_at:
211 sym_at_.append((addr, name, size))
567 size = os.path.getsize(path)
568 if size == 0:
572 perjob = m.ceil(size // jobs)
573 trace_ranges.append([(i, i+perjob) for i in range(0, size, perjob)])
/littlefs-3.7.0-3.6.0/
Dlfs.c50 void *buffer, lfs_size_t size) { in lfs_bd_read() argument
52 if (off+size > lfs->cfg->block_size in lfs_bd_read()
57 while (size > 0) { in lfs_bd_read()
58 lfs_size_t diff = size; in lfs_bd_read()
61 off < pcache->off + pcache->size) { in lfs_bd_read()
64 diff = lfs_min(diff, pcache->size - (off-pcache->off)); in lfs_bd_read()
69 size -= diff; in lfs_bd_read()
78 off < rcache->off + rcache->size) { in lfs_bd_read()
81 diff = lfs_min(diff, rcache->size - (off-rcache->off)); in lfs_bd_read()
86 size -= diff; in lfs_bd_read()
[all …]
Dlfs.h166 lfs_off_t off, void *buffer, lfs_size_t size);
172 lfs_off_t off, const void *buffer, lfs_size_t size);
282 lfs_size_t size; member
323 lfs_size_t size; member
354 lfs_size_t size; member
389 lfs_size_t size; member
435 lfs_block_t size; member
521 uint8_t type, void *buffer, lfs_size_t size);
532 uint8_t type, const void *buffer, lfs_size_t size);
594 void *buffer, lfs_size_t size);
[all …]
DSPEC.md26 - In addition to the logical block size (which usually matches the erase
27 block size), littlefs also uses a program block size and read block size.
88 aligned to our program block size. This means each commit may have padding for
333 [1| 3| 8 | 10 | 10 ][--- (size * 8) ---]
334 ^ ^ ^ ^ ^- size ^- file name
404 ^ ^ ^ ^- size (8) ^- magic string ("littlefs")
412 ^ ^ ^ ^ ^- version ^- block size ^- block count
416 | | | '- size (24)
433 3. **Block size (32-bits)** - Size of the logical block size used by the
438 5. **Name max (32-bits)** - Maximum size of file names in bytes.
[all …]
Dlfs_util.h215 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size);
219 static inline void *lfs_malloc(size_t size) { in lfs_malloc() argument
221 return malloc(size); in lfs_malloc()
223 (void)size; in lfs_malloc()
DDESIGN.md29 size in mind.
64 size or number of files. This creates a unique challenge as even presumably
180 parallel, which comes with a code size cost. They also offer no protection
239 can't avoid these costs, _but_ if we put an upper bound on the size we can at
293 storage, in the worst case a small log costs 4x the size of the original data.
357 1. If our block is not full and the program size is small enough to let us
448 increasing the size of the log and dealing with the scalability issues
514 If we let ![r] be the ratio of static space to the size of our log in bytes, we
517 ![s = r (size/n)][metadata-formula2]
519 ![d = (1 - r) (size/n)][metadata-formula3]
[all …]
Dlfs_util.c15 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size) { in lfs_crc() argument
25 for (size_t i = 0; i < size; i++) { in lfs_crc()
/littlefs-3.7.0-3.6.0/bd/
Dlfs_filebd.c66 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_filebd_read() argument
69 (void*)cfg, block, off, buffer, size); in lfs_filebd_read()
75 LFS_ASSERT(size % bd->cfg->read_size == 0); in lfs_filebd_read()
76 LFS_ASSERT(off+size <= bd->cfg->erase_size); in lfs_filebd_read()
79 memset(buffer, 0, size); in lfs_filebd_read()
90 ssize_t res2 = read(bd->fd, buffer, size); in lfs_filebd_read()
102 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_filebd_prog() argument
105 (void*)cfg, block, off, buffer, size); in lfs_filebd_prog()
111 LFS_ASSERT(size % bd->cfg->prog_size == 0); in lfs_filebd_prog()
112 LFS_ASSERT(off+size <= bd->cfg->erase_size); in lfs_filebd_prog()
[all …]
Dlfs_rambd.c56 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_rambd_read() argument
59 (void*)cfg, block, off, buffer, size); in lfs_rambd_read()
65 LFS_ASSERT(size % bd->cfg->read_size == 0); in lfs_rambd_read()
66 LFS_ASSERT(off+size <= bd->cfg->erase_size); in lfs_rambd_read()
69 memcpy(buffer, &bd->buffer[block*bd->cfg->erase_size + off], size); in lfs_rambd_read()
76 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_rambd_prog() argument
79 (void*)cfg, block, off, buffer, size); in lfs_rambd_prog()
85 LFS_ASSERT(size % bd->cfg->prog_size == 0); in lfs_rambd_prog()
86 LFS_ASSERT(off+size <= bd->cfg->erase_size); in lfs_rambd_prog()
89 memcpy(&bd->buffer[block*bd->cfg->erase_size + off], buffer, size); in lfs_rambd_prog()
Dlfs_emubd.c216 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_emubd_read() argument
219 (void*)cfg, block, off, buffer, size); in lfs_emubd_read()
225 LFS_ASSERT(size % bd->cfg->read_size == 0); in lfs_emubd_read()
226 LFS_ASSERT(off+size <= bd->cfg->erase_size); in lfs_emubd_read()
239 memcpy(buffer, &b->data[off], size); in lfs_emubd_read()
244 size); in lfs_emubd_read()
248 bd->readed += size; in lfs_emubd_read()
266 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_emubd_prog() argument
269 (void*)cfg, block, off, buffer, size); in lfs_emubd_prog()
275 LFS_ASSERT(size % bd->cfg->prog_size == 0); in lfs_emubd_prog()
[all …]
Dlfs_filebd.h60 lfs_off_t off, void *buffer, lfs_size_t size);
66 lfs_off_t off, const void *buffer, lfs_size_t size);

12