/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_alloc.toml | 7 define.SIZE = '(((LFS_BLOCK_SIZE-8)*(LFS_BLOCK_COUNT-6)) / FILES)' 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); 50 define.SIZE = '(((LFS_BLOCK_SIZE-8)*(LFS_BLOCK_COUNT-6)) / FILES)' 64 size = strlen(names[n]); [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_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; 23 define.SIZE = [32, 8192, 262144, 0, 7, 8193] 33 for (lfs_size_t i = 0; i < SIZE; i += CHUNKSIZE) { 34 lfs_size_t chunk = lfs_min(CHUNKSIZE, SIZE-i); 46 lfs_file_size(&lfs, &file) => SIZE; 48 for (lfs_size_t i = 0; i < SIZE; i += CHUNKSIZE) { 49 lfs_size_t chunk = lfs_min(CHUNKSIZE, SIZE-i); 289 define.SIZE = [32, 0, 7, 2049] [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_interspersed.toml | 3 define.SIZE = [10, 100] 16 for (int i = 0; i < SIZE; i++) { 38 assert(info.size == SIZE); 63 define.SIZE = [10, 100] 73 for (int i = 0; i < SIZE; i++) { 101 assert(info.size == FILES); 116 define.SIZE = [10, 100] 125 for (int i = 0; i < SIZE/2; i++) { 133 for (int i = 0; i < SIZE/2; i++) { 153 assert(info.size == SIZE); [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_evil.toml | 77 define.SIZE = [10, 1000, 100000] # faked file size 101 &(struct lfs_ctz){0xcccccccc, lfs_tole32(SIZE)}})) => 0; 110 assert(info.size == SIZE); 113 lfs_file_read(&lfs, &file, buffer, SIZE) => LFS_ERR_CORRUPT; 117 if (SIZE > 2*LFS_BLOCK_SIZE) { 124 define.SIZE = ['2*LFS_BLOCK_SIZE', '3*LFS_BLOCK_SIZE', '4*LFS_BLOCK_SIZE'] 133 for (int i = 0; i < SIZE; i++) { 171 assert(info.size == SIZE); 174 lfs_file_read(&lfs, &file, buffer, SIZE) => LFS_ERR_CORRUPT; 178 if (SIZE > 2*LFS_BLOCK_SIZE) {
|
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_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 | .travis.yml | 20 - sudo mount -t tmpfs -o size=100m tmpfs disks 58 _: &test-odd-block-size 61 # report size 62 _: &report-size 63 # compile and find the code size with the smallest configuration 64 - make -j1 clean size 76 | capture(\"code size is (?<size>[0-9]+)\").size" \ 79 STATUS="Passed, code size is ${CURR}B" 100 script: [*test-example, *report-size] 101 - {<<: *x86, script: [*test-default, *report-size]} [all …]
|
D | lfs.h | 47 // Maximum name size in bytes, may be redefined to reduce the size of the 54 // Maximum size of a file in bytes, may be redefined to limit to support other 63 // Maximum size of custom attributes in bytes, may be redefined, but there is 130 LFS_O_TRUNC = 0x0400, // Truncate the existing file to zero size 159 lfs_off_t off, void *buffer, lfs_size_t size); 165 lfs_off_t off, const void *buffer, lfs_size_t size); 177 // Minimum size of a block read. All read operations will be a 181 // Minimum size of a block program. All program operations will be a 185 // Size of an erasable block. This does not impact ram consumption and 186 // may be larger than the physical erase size. However, non-inlined files [all …]
|
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 | 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 | Makefile | 8 SIZE ?= size macro 41 size: $(OBJ) target 42 $(SIZE) -t $^
|
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.h | 142 // Align to nearest multiple of a size 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 | 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/scripts/ |
D | explode_asserts.py | 42 static void __{prefix}_assert_print_{type}({ctype} v, size_t size) {{ 43 (void)size; 64 static void __{prefix}_assert_print_{type}({ctype} v, size_t size) {{ 65 (void)size; 86 static void __{prefix}_assert_print_{type}({ctype} v, size_t size) {{ 89 for (size_t i = 0; i < size && i < {maxwidth}; i++) {{ 96 if (size > {maxwidth}) {{ 103 #define __{PREFIX}_ASSERT_{TYPE}_{COMP}(file, line, lh, rh, size) 107 if (!(memcmp(_lh, _rh, size) {op} 0)) {{ 109 _lh, size, _rh, size); [all …]
|
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': [all …]
|
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)) 170 help="Size of a block in bytes.")
|
/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()
|