/littlefs-latest/tests/ |
D | test_entries.toml | 19 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 …]
|
D | test_seek.toml | 19 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 …]
|
D | test_truncate.toml | 16 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 …]
|
D | test_alloc.toml | 37 size_t size = strlen(names[n]); 38 for (lfs_size_t i = 0; i < SIZE; i += size) { 39 lfs_file_write(&lfs, &files[n], names[n], size) => size; 53 size_t size = strlen(names[n]); 54 for (lfs_size_t i = 0; i < SIZE; i += size) { 56 lfs_file_read(&lfs, &file, buffer, size) => size; 57 assert(memcmp(buffer, names[n], size) == 0); 91 size_t size = strlen(names[n]); 93 memcpy(buffer, names[n], size); 94 for (int i = 0; i < SIZE; i += size) { [all …]
|
D | test_powerloss.toml | 18 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 …]
|
D | test_badblocks.toml | 43 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 …]
|
D | test_files.toml | 11 lfs_size_t size = strlen("Hello World!")+1; 14 lfs_file_write(&lfs, &file, buffer, size) => size; 20 lfs_file_read(&lfs, &file, buffer, size) => size; 330 // can only be 0 (new file) or full size 331 lfs_size_t size = lfs_file_size(&lfs, &file); 332 assert(size == 0 || size == SIZE); 396 // with syncs we could be any size, but it at least must be valid data 397 lfs_size_t size = lfs_file_size(&lfs, &file); 398 assert(size <= SIZE); 400 for (lfs_size_t i = 0; i < size; i += CHUNKSIZE) { [all …]
|
D | test_exhaustion.toml | 25 // 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 …]
|
D | test_move.toml | 44 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); 389 assert(info.size == 5+8+6 || info.size == 0); 395 assert(info.size == 5+8+6); 401 assert(info.size == 5+8+6); 407 assert(info.size == 5+8+6); 414 if (lfs_stat(&lfs, "a/hello", &info) == 0 && info.size > 0) { 459 assert(info.size == 5+8+6); [all …]
|
D | test_interspersed.toml | 43 assert(info.size == SIZE); 115 assert(info.size == FILES); 171 assert(info.size == SIZE); 175 assert(info.size == SIZE); 222 lfs_ssize_t size = lfs_file_size(&lfs, &files[j]); 223 assert(size >= 0); 224 if ((int)size <= i) { 250 assert(info.size == SIZE);
|
D | test_attrs.toml | 196 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-latest/scripts/ |
D | tracebd.py | 343 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 …]
|
D | readmdir.py | 47 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':
|
D | prettyasserts.py | 213 def mkassert(type, cmp, lh, rh, size=None): argument 214 if size is not None: 216 % (type.upper(), cmp.upper(), lh, rh, size)) 294 size = p_expr(p) ; p.accept('ws') 299 return mkassert('mem', CMP[cmp], lh, rh, size) 387 size = p_expr(p) ; p.accept('ws') 391 return ws + mkassert('mem', 'eq', lh, rh, size)
|
D | perfbd.py | 189 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)])
|
D | readtree.py | 43 if mdir.tail.size != 8 or mdir.tail.data == 8*b'\xff': 115 if tag.size or not tag.isvalid: 116 print(" orphans >=%d" % max(tag.size, 1))
|
/littlefs-latest/ |
D | lfs.c | 50 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 …]
|
D | lfs.h | 165 lfs_off_t off, void *buffer, lfs_size_t size); 171 lfs_off_t off, const void *buffer, lfs_size_t size); 301 lfs_size_t size; member 342 lfs_size_t size; member 373 lfs_size_t size; member 408 lfs_size_t size; member 454 lfs_block_t size; member 541 uint8_t type, void *buffer, lfs_size_t size); 552 uint8_t type, const void *buffer, lfs_size_t size); 614 void *buffer, lfs_size_t size); [all …]
|
D | SPEC.md | 26 - 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 …]
|
D | lfs_util.h | 234 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size) { in lfs_crc() argument 235 return LFS_CRC(crc, buffer, size) in lfs_crc() 238 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); 245 static inline void *lfs_malloc(size_t size) { 247 return LFS_MALLOC(size); 249 return malloc(size); 251 (void)size;
|
D | DESIGN.md | 29 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 …]
|
D | lfs_util.c | 17 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size) { in lfs_crc() argument 27 for (size_t i = 0; i < size; i++) { in lfs_crc()
|
/littlefs-latest/bd/ |
D | lfs_filebd.c | 66 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 …]
|
D | lfs_rambd.c | 56 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()
|
D | lfs_emubd.c | 288 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_emubd_read() argument 291 (void*)cfg, block, off, buffer, size); in lfs_emubd_read() 297 LFS_ASSERT(size % bd->cfg->read_size == 0); in lfs_emubd_read() 298 LFS_ASSERT(off+size <= bd->cfg->erase_size); in lfs_emubd_read() 311 memcpy(buffer, &b->data[off], size); in lfs_emubd_read() 316 size); in lfs_emubd_read() 320 bd->readed += size; in lfs_emubd_read() 338 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_emubd_prog() argument 341 (void*)cfg, block, off, buffer, size); in lfs_emubd_prog() 347 LFS_ASSERT(size % bd->cfg->prog_size == 0); in lfs_emubd_prog() [all …]
|