/littlefs-2.7.6/tests/ |
D | test_entries.toml | 17 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 …]
|
D | test_seek.toml | 16 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 …]
|
D | test_truncate.toml | 11 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 …]
|
D | test_alloc.toml | 24 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 …]
|
D | test_badblocks.toml | 40 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 …]
|
D | test_files.toml | 8 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 …]
|
D | test_exhaustion.toml | 23 // 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 …]
|
D | test_move.toml | 40 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 …]
|
D | test_interspersed.toml | 38 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);
|
D | test_attrs.toml | 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; 235 attrs1[0].size = 4;
|
/littlefs-2.7.6/ |
D | lfs.c | 30 void *buffer, lfs_size_t size) { in lfs_bd_read() argument 33 off+size > lfs->cfg->block_size) { in lfs_bd_read() 37 while (size > 0) { in lfs_bd_read() 38 lfs_size_t diff = size; in lfs_bd_read() 41 off < pcache->off + pcache->size) { in lfs_bd_read() 44 diff = lfs_min(diff, pcache->size - (off-pcache->off)); in lfs_bd_read() 49 size -= diff; in lfs_bd_read() 58 off < rcache->off + rcache->size) { in lfs_bd_read() 61 diff = lfs_min(diff, rcache->size - (off-rcache->off)); in lfs_bd_read() 66 size -= diff; in lfs_bd_read() [all …]
|
D | lfs.h | 159 lfs_off_t off, void *buffer, lfs_size_t size); 165 lfs_off_t off, const void *buffer, lfs_size_t size); 251 lfs_size_t size; member 271 lfs_size_t size; member 302 lfs_size_t size; member 337 lfs_size_t size; member 383 lfs_block_t size; member 462 uint8_t type, void *buffer, lfs_size_t size); 472 uint8_t type, const void *buffer, lfs_size_t size); 526 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 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 …]
|
D | lfs_util.h | 243 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); 247 static inline void *lfs_malloc(size_t size) { in lfs_malloc() argument 249 return malloc(size); in lfs_malloc() 251 (void)size; in lfs_malloc()
|
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 | 14 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size) { in lfs_crc() argument 24 for (size_t i = 0; i < size; i++) { in lfs_crc()
|
/littlefs-2.7.6/bd/ |
D | lfs_testbd.c | 107 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_testbd_rawread() argument 110 return lfs_filebd_read(cfg, block, off, buffer, size); in lfs_testbd_rawread() 112 return lfs_rambd_read(cfg, block, off, buffer, size); in lfs_testbd_rawread() 117 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_testbd_rawprog() argument 120 return lfs_filebd_prog(cfg, block, off, buffer, size); in lfs_testbd_rawprog() 122 return lfs_rambd_prog(cfg, block, off, buffer, size); in lfs_testbd_rawprog() 147 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_testbd_read() argument 150 (void*)cfg, block, off, buffer, size); in lfs_testbd_read() 155 LFS_ASSERT(size % cfg->read_size == 0); in lfs_testbd_read() 166 int err = lfs_testbd_rawread(cfg, block, off, buffer, size); in lfs_testbd_read() [all …]
|
D | lfs_rambd.c | 72 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_rambd_read() argument 75 (void*)cfg, block, off, buffer, size); in lfs_rambd_read() 80 LFS_ASSERT(size % cfg->read_size == 0); in lfs_rambd_read() 84 memcpy(buffer, &bd->buffer[block*cfg->block_size + off], size); in lfs_rambd_read() 91 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_rambd_prog() argument 94 (void*)cfg, block, off, buffer, size); in lfs_rambd_prog() 99 LFS_ASSERT(size % cfg->prog_size == 0); in lfs_rambd_prog() 104 for (lfs_off_t i = 0; i < size; i++) { in lfs_rambd_prog() 111 memcpy(&bd->buffer[block*cfg->block_size + off], buffer, size); in lfs_rambd_prog()
|
D | lfs_filebd.c | 72 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_filebd_read() argument 75 (void*)cfg, block, off, buffer, size); in lfs_filebd_read() 80 LFS_ASSERT(size % cfg->read_size == 0); in lfs_filebd_read() 85 memset(buffer, bd->cfg->erase_value, size); in lfs_filebd_read() 97 ssize_t res2 = read(bd->fd, buffer, size); in lfs_filebd_read() 109 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_filebd_prog() argument 111 (void*)cfg, block, off, buffer, size); in lfs_filebd_prog() 116 LFS_ASSERT(size % cfg->prog_size == 0); in lfs_filebd_prog() 129 for (lfs_off_t i = 0; i < size; i++) { in lfs_filebd_prog() 151 ssize_t res2 = write(bd->fd, buffer, size); in lfs_filebd_prog()
|
D | lfs_rambd.h | 53 lfs_off_t off, void *buffer, lfs_size_t size); 59 lfs_off_t off, const void *buffer, lfs_size_t size);
|
D | lfs_filebd.h | 51 lfs_off_t off, void *buffer, lfs_size_t size); 57 lfs_off_t off, const void *buffer, lfs_size_t size);
|
D | lfs_testbd.h | 108 lfs_off_t off, void *buffer, lfs_size_t size); 114 lfs_off_t off, const void *buffer, lfs_size_t size);
|
/littlefs-2.7.6/scripts/ |
D | readmdir.py | 45 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':
|
D | explode_asserts.py | 164 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)
|
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))
|