Home
last modified time | relevance | path

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

12

/littlefs-3.5.0-3.4.0/tests/
Dtest_entries.toml17 sprintf(path, "hi0"); size = 20;
20 memset(wbuffer, 'c', size);
21 lfs_file_write(&lfs, &file, wbuffer, size) => size;
22 lfs_file_size(&lfs, &file) => size;
25 sprintf(path, "hi1"); size = 20;
28 memset(wbuffer, 'c', size);
29 lfs_file_write(&lfs, &file, wbuffer, size) => size;
30 lfs_file_size(&lfs, &file) => size;
33 sprintf(path, "hi2"); size = 20;
36 memset(wbuffer, 'c', size);
[all …]
Dtest_seek.toml16 size = strlen("kittycatcat");
17 memcpy(buffer, "kittycatcat", size);
19 lfs_file_write(&lfs, &file, buffer, size);
28 size = strlen("kittycatcat");
30 lfs_file_read(&lfs, &file, buffer, size) => size;
31 memcmp(buffer, "kittycatcat", size) => 0;
37 lfs_file_read(&lfs, &file, buffer, size) => size;
38 memcmp(buffer, "kittycatcat", size) => 0;
41 lfs_file_read(&lfs, &file, buffer, size) => size;
42 memcmp(buffer, "kittycatcat", size) => 0;
[all …]
Dtest_truncate.toml11 size = strlen((char*)buffer);
12 for (lfs_off_t j = 0; j < LARGESIZE; j += size) {
13 lfs_file_write(&lfs, &file, buffer, size) => size;
34 size = strlen("hair");
35 for (lfs_off_t j = 0; j < MEDIUMSIZE; j += size) {
36 lfs_file_read(&lfs, &file, buffer, size) => size;
37 memcmp(buffer, "hair", size) => 0;
39 lfs_file_read(&lfs, &file, buffer, size) => 0;
55 size = strlen((char*)buffer);
56 for (lfs_off_t j = 0; j < LARGESIZE; j += size) {
[all …]
Dtest_alloc.toml24 size = strlen(names[n]);
25 for (lfs_size_t i = 0; i < SIZE; i += size) {
26 lfs_file_write(&lfs, &files[n], names[n], size) => size;
38 size = strlen(names[n]);
39 for (lfs_size_t i = 0; i < SIZE; i += size) {
40 lfs_file_read(&lfs, &file, buffer, size) => size;
41 assert(memcmp(buffer, names[n], size) == 0);
64 size = strlen(names[n]);
65 memcpy(buffer, names[n], size);
66 for (int i = 0; i < SIZE; i += size) {
[all …]
Dtest_badblocks.toml40 size = NAMEMULT;
42 lfs_file_write(&lfs, &file, buffer, size) => size;
65 size = NAMEMULT;
68 lfs_file_read(&lfs, &file, rbuffer, size) => size;
69 memcmp(buffer, rbuffer, size) => 0;
114 size = NAMEMULT;
116 lfs_file_write(&lfs, &file, buffer, size) => size;
139 size = NAMEMULT;
142 lfs_file_read(&lfs, &file, rbuffer, size) => size;
143 memcmp(buffer, rbuffer, size) => 0;
[all …]
Dtest_files.toml8 size = strlen("Hello World!")+1;
10 lfs_file_write(&lfs, &file, buffer, size) => size;
16 lfs_file_read(&lfs, &file, buffer, size) => size;
302 // can only be 0 (new file) or full size
303 size = lfs_file_size(&lfs, &file);
304 assert(size == 0 || size == SIZE);
356 // with syncs we could be any size, but it at least must be valid data
357 size = lfs_file_size(&lfs, &file);
358 assert(size <= SIZE);
360 for (lfs_size_t i = 0; i < size; i += CHUNKSIZE) {
[all …]
Dtest_exhaustion.toml23 // chose name, roughly random seed, and random 2^n size
26 size = 1 << ((rand() % 10)+2);
31 for (lfs_size_t j = 0; j < size; j++) {
55 size = 1 << ((rand() % 10)+2);
58 for (lfs_size_t j = 0; j < size; j++) {
105 // chose name, roughly random seed, and random 2^n size
108 size = 1 << ((rand() % 10)+2);
113 for (lfs_size_t j = 0; j < size; j++) {
137 size = 1 << ((rand() % 10)+2);
140 for (lfs_size_t j = 0; j < size; j++) {
[all …]
Dtest_move.toml40 assert(info.size == 5+8+6);
131 assert(info.size == 5+8+6);
214 assert(info.size == 5+8+6);
320 assert(info.size == 5+8+6);
363 assert(info.size == 5+8+6 || info.size == 0);
369 assert(info.size == 5+8+6);
375 assert(info.size == 5+8+6);
381 assert(info.size == 5+8+6);
388 if (lfs_stat(&lfs, "a/hello", &info) == 0 && info.size > 0) {
430 assert(info.size == 5+8+6);
[all …]
Dtest_interspersed.toml38 assert(info.size == SIZE);
101 assert(info.size == FILES);
153 assert(info.size == SIZE);
157 assert(info.size == SIZE);
197 size = lfs_file_size(&lfs, &files[j]);
198 assert((int)size >= 0);
199 if ((int)size <= i) {
222 assert(info.size == SIZE);
Dtest_attrs.toml187 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;
235 attrs1[0].size = 4;
/littlefs-3.5.0-3.4.0/
Dlfs.c51 void *buffer, lfs_size_t size) { in lfs_bd_read() argument
54 off+size > lfs->cfg->block_size) { in lfs_bd_read()
58 while (size > 0) { in lfs_bd_read()
59 lfs_size_t diff = size; in lfs_bd_read()
62 off < pcache->off + pcache->size) { in lfs_bd_read()
65 diff = lfs_min(diff, pcache->size - (off-pcache->off)); in lfs_bd_read()
70 size -= diff; in lfs_bd_read()
79 off < rcache->off + rcache->size) { in lfs_bd_read()
82 diff = lfs_min(diff, rcache->size - (off-rcache->off)); in lfs_bd_read()
87 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);
274 lfs_size_t size; member
294 lfs_size_t size; member
325 lfs_size_t size; member
360 lfs_size_t size; member
406 lfs_block_t size; member
491 uint8_t type, void *buffer, lfs_size_t size);
502 uint8_t type, const void *buffer, lfs_size_t size);
564 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
292 [1| 3| 8 | 10 | 10 ][--- (size * 8) ---]
293 ^ ^ ^ ^ ^- size ^- file name
363 ^ ^ ^ ^- size (8) ^- magic string ("littlefs")
371 ^ ^ ^ ^ ^- version ^- block size ^- block count
375 | | | '- size (24)
392 3. **Block size (32-bits)** - Size of the logical block size used by the
397 5. **Name max (32-bits)** - Maximum size of file names in bytes.
[all …]
Dlfs_util.h217 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size);
221 static inline void *lfs_malloc(size_t size) { in lfs_malloc() argument
223 return malloc(size); in lfs_malloc()
225 (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.5.0-3.4.0/scripts/
Dstructs.py59 size = None
77 and size is not None):
79 results[(decl, name)] = size
83 size = None
89 size = int(m.group('size'))
98 for (file, struct), size in results.items():
112 flat_results.append((file, struct, size))
154 for _, _, size in results:
155 total += size
172 for _, _, size in prev_results:
[all …]
Ddata.py48 for (file, func), size in results.items():
61 flat_results.append((file, func, size))
102 for _, _, size in results:
103 total += size
120 for _, _, size in prev_results:
121 prev_total += size
142 for file, func, size in results:
143 merged_results[(file, func)]['data_size'] = size
154 for file, func, size in results:
156 entries[entry] += size
[all …]
Dcode.py48 for (file, func), size in results.items():
62 flat_results.append((file, func, size))
103 for _, _, size in results:
104 total += size
121 for _, _, size in prev_results:
122 prev_total += size
143 for file, func, size in results:
144 merged_results[(file, func)]['code_size'] = size
155 for file, func, size in results:
157 entries[entry] += size
[all …]
Dreadmdir.py45 size = int(args[2], str) if args[2] not in 'x.' else 0x3ff
47 size = args[2]
49 self.tag = (type << 20) | (id << 10) | size
86 def size(self): member in Tag
91 return 4 + (self.size if self.size != 0x3ff else 0)
111 ntag = Tag(self.type, nid, self.size)
138 return repr(self.size) if self.size != 0x3ff else 'x'
141 return 'Tag(%r, %d, %d)' % (self.typerepr(), self.id, self.size)
267 if tag.size == 0x3ff:
324 if mdir.tail.size != 8 or mdir.tail.data == 8*b'\xff':
Dexplode_asserts.py164 def mkassert(type, comp, lh, rh, size=None): argument
171 'size': size,
173 if size:
270 size = pexpr(p) ; p.accept('ws')
275 return mkassert('mem', COMP[comp], lh, rh, size)
/littlefs-3.5.0-3.4.0/bd/
Dlfs_testbd.c108 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_testbd_rawread() argument
111 return lfs_filebd_read(cfg, block, off, buffer, size); in lfs_testbd_rawread()
113 return lfs_rambd_read(cfg, block, off, buffer, size); in lfs_testbd_rawread()
118 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_testbd_rawprog() argument
121 return lfs_filebd_prog(cfg, block, off, buffer, size); in lfs_testbd_rawprog()
123 return lfs_rambd_prog(cfg, block, off, buffer, size); in lfs_testbd_rawprog()
148 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_testbd_read() argument
151 (void*)cfg, block, off, buffer, size); in lfs_testbd_read()
156 LFS_ASSERT(size % cfg->read_size == 0); in lfs_testbd_read()
167 int err = lfs_testbd_rawread(cfg, block, off, buffer, size); in lfs_testbd_read()
[all …]
Dlfs_rambd.c75 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_rambd_read() argument
78 (void*)cfg, block, off, buffer, size); in lfs_rambd_read()
83 LFS_ASSERT(size % cfg->read_size == 0); in lfs_rambd_read()
87 memcpy(buffer, &bd->buffer[block*cfg->block_size + off], size); in lfs_rambd_read()
94 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_rambd_prog() argument
97 (void*)cfg, block, off, buffer, size); in lfs_rambd_prog()
102 LFS_ASSERT(size % cfg->prog_size == 0); in lfs_rambd_prog()
107 for (lfs_off_t i = 0; i < size; i++) { in lfs_rambd_prog()
114 memcpy(&bd->buffer[block*cfg->block_size + off], buffer, size); in lfs_rambd_prog()
Dlfs_filebd.c82 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_filebd_read() argument
85 (void*)cfg, block, off, buffer, size); in lfs_filebd_read()
90 LFS_ASSERT(size % cfg->read_size == 0); in lfs_filebd_read()
95 memset(buffer, bd->cfg->erase_value, size); in lfs_filebd_read()
107 ssize_t res2 = read(bd->fd, buffer, size); in lfs_filebd_read()
119 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_filebd_prog() argument
121 (void*)cfg, block, off, buffer, size); in lfs_filebd_prog()
126 LFS_ASSERT(size % cfg->prog_size == 0); in lfs_filebd_prog()
139 for (lfs_off_t i = 0; i < size; i++) { in lfs_filebd_prog()
161 ssize_t res2 = write(bd->fd, buffer, size); in lfs_filebd_prog()
Dlfs_filebd.h52 lfs_off_t off, void *buffer, lfs_size_t size);
58 lfs_off_t off, const void *buffer, lfs_size_t size);

12