/littlefs-3.7.0-3.6.0/tests/ |
D | test_bd.toml | 2 # sure the underlying block device is working. 37 lfs_block_t block; 39 // write block 0 40 block = 0; 41 cfg->erase(cfg, block) => 0; 44 buffer[j] = (block+i+j) % 251; 46 cfg->prog(cfg, block, i, buffer, PROG) => 0; 49 // read block 0 50 block = 0; 52 cfg->read(cfg, block, i, buffer, READ) => 0; [all …]
|
D | test_move.toml | 108 lfs_block_t block = dir.m.pair[0]; 112 cfg->read(cfg, block, 0, buffer, BLOCK_SIZE) => 0; 118 cfg->erase(cfg, block) => 0; 119 cfg->prog(cfg, block, 0, buffer, BLOCK_SIZE) => 0; 189 lfs_block_t block = dir.m.pair[0]; 193 cfg->read(cfg, block, 0, buffer, BLOCK_SIZE) => 0; 199 cfg->erase(cfg, block) => 0; 200 cfg->prog(cfg, block, 0, buffer, BLOCK_SIZE) => 0; 206 block = dir.m.pair[0]; 209 cfg->read(cfg, block, 0, buffer, BLOCK_SIZE) => 0; [all …]
|
D | test_powerloss.toml | 134 lfs_block_t block = dir.m.pair[0]; 141 cfg->read(cfg, block, 0, bbuffer, BLOCK_SIZE) => 0; 145 cfg->erase(cfg, block) => 0; 146 cfg->prog(cfg, block, 0, bbuffer, BLOCK_SIZE) => 0;
|
D | test_orphans.toml | 20 lfs_block_t block = dir.m.pair[0]; 24 cfg->read(cfg, block, 0, buffer, BLOCK_SIZE) => 0; 30 cfg->erase(cfg, block) => 0; 31 cfg->prog(cfg, block, 0, buffer, BLOCK_SIZE) => 0;
|
D | test_alloc.toml | 385 # what if we have a bad block during an allocation scan? 426 // but mark the head of our file as a "bad block", this is force our 441 // now reverse the "bad block" and try to write the file again until we 476 # on the geometry of the block device. But they are valuable. Eventually they 566 // create one block hole for half a directory 712 // rewrite one file with a hole of one block
|
D | test_exhaustion.toml | 184 # of wear-leveling is that increasing a block device's space translates directly 185 # into increasing the block devices lifetime. This is something we can actually 471 // check the wear on our block device
|
D | test_badblocks.toml | 1 # bad blocks with block cycles should be tested in test_relocations
|
D | test_evil.toml | 168 // rewrite block to contain bad pointer
|
D | test_superblocks.toml | 330 .pair = {0, 0}, // make sure this goes into block 0
|
/littlefs-3.7.0-3.6.0/bd/ |
D | lfs_emubd.c | 32 static lfs_emubd_block_t *lfs_emubd_incblock(lfs_emubd_block_t *block) { in lfs_emubd_incblock() argument 33 if (block) { in lfs_emubd_incblock() 34 block->rc += 1; in lfs_emubd_incblock() 36 return block; in lfs_emubd_incblock() 39 static void lfs_emubd_decblock(lfs_emubd_block_t *block) { in lfs_emubd_decblock() argument 40 if (block) { in lfs_emubd_decblock() 41 block->rc -= 1; in lfs_emubd_decblock() 42 if (block->rc == 0) { in lfs_emubd_decblock() 43 free(block); in lfs_emubd_decblock() 50 lfs_emubd_block_t **block) { in lfs_emubd_mutblock() argument [all …]
|
D | lfs_rambd.c | 55 int lfs_rambd_read(const struct lfs_config *cfg, lfs_block_t block, in lfs_rambd_read() argument 59 (void*)cfg, block, off, buffer, size); in lfs_rambd_read() 63 LFS_ASSERT(block < bd->cfg->erase_count); in lfs_rambd_read() 69 memcpy(buffer, &bd->buffer[block*bd->cfg->erase_size + off], size); in lfs_rambd_read() 75 int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, in lfs_rambd_prog() argument 79 (void*)cfg, block, off, buffer, size); in lfs_rambd_prog() 83 LFS_ASSERT(block < bd->cfg->erase_count); in lfs_rambd_prog() 89 memcpy(&bd->buffer[block*bd->cfg->erase_size + off], buffer, size); in lfs_rambd_prog() 95 int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block) { in lfs_rambd_erase() argument 97 (void*)cfg, block, ((lfs_rambd_t*)cfg->context)->cfg->erase_size); in lfs_rambd_erase() [all …]
|
D | lfs_filebd.c | 65 int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, in lfs_filebd_read() argument 69 (void*)cfg, block, off, buffer, size); in lfs_filebd_read() 73 LFS_ASSERT(block < bd->cfg->erase_count); in lfs_filebd_read() 83 (off_t)block*bd->cfg->erase_size + (off_t)off, SEEK_SET); in lfs_filebd_read() 101 int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, in lfs_filebd_prog() argument 105 (void*)cfg, block, off, buffer, size); in lfs_filebd_prog() 109 LFS_ASSERT(block < bd->cfg->erase_count); in lfs_filebd_prog() 116 (off_t)block*bd->cfg->erase_size + (off_t)off, SEEK_SET); in lfs_filebd_prog() 134 int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block) { in lfs_filebd_erase() argument 136 (void*)cfg, block, ((lfs_file_t*)cfg->context)->cfg->erase_size); in lfs_filebd_erase() [all …]
|
D | lfs_emubd.h | 171 int lfs_emubd_read(const struct lfs_config *cfg, lfs_block_t block, 177 int lfs_emubd_prog(const struct lfs_config *cfg, lfs_block_t block, 184 int lfs_emubd_erase(const struct lfs_config *cfg, lfs_block_t block); 194 lfs_block_t block, uint32_t *crc); 219 lfs_block_t block); 223 lfs_block_t block, lfs_emubd_wear_t wear);
|
D | lfs_filebd.h | 59 int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, 65 int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, 72 int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block);
|
D | lfs_rambd.h | 62 int lfs_rambd_read(const struct lfs_config *cfg, lfs_block_t block, 68 int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, 75 int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block);
|
/littlefs-3.7.0-3.6.0/ |
D | DESIGN.md | 52 repeatedly writes to the same block, eventually that block will wear out. 75 1. First we have the non-resilient, block based filesystems, such as [FAT] and 143 offspring that happens when you mate a block based filesystem with a logging 145 block based filesystem and add a bounded log where we note every change 174 as fast as a block based filesystem (though updating the journal does have 185 [btrfs] and [ZFS]. These are very similar to other block based filesystems, 186 but instead of updating block inplace, all updates are performed by creating 187 a copy with the changes and replacing any references to the old block with 188 our new block. This recursively pushes all of our problems upwards until we 216 block based filesystems while managing to pull off atomic updates without [all …]
|
D | SPEC.md | 20 - littlefs is a block-based filesystem. The disk is divided into an array of 24 representing a null block address. 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. 28 These determine the alignment of block device operations, but don't need 38 As their name suggests, a metadata pair is stored in two blocks, with one block 41 metadata pair is stored as two block pointers. 43 On top of this, each metadata block behaves as an appendable log, containing a 49 The high-level layout of a metadata block is fairly simple: 82 Each metadata block contains a 32-bit revision count followed by a number of [all …]
|
D | lfs.c | 38 rcache->block = LFS_BLOCK_NULL; in lfs_cache_drop() 44 pcache->block = LFS_BLOCK_NULL; in lfs_cache_zero() 49 lfs_block_t block, lfs_off_t off, in lfs_bd_read() argument 53 || (lfs->block_count && block >= lfs->block_count)) { in lfs_bd_read() 60 if (pcache && block == pcache->block && in lfs_bd_read() 77 if (block == rcache->block && in lfs_bd_read() 98 int err = lfs->cfg->read(lfs->cfg, block, off, data, diff); in lfs_bd_read() 110 LFS_ASSERT(!lfs->block_count || block < lfs->block_count); in lfs_bd_read() 111 rcache->block = block; in lfs_bd_read() 119 int err = lfs->cfg->read(lfs->cfg, rcache->block, in lfs_bd_read() [all …]
|
D | README.md | 43 // block device operations 49 // block device configuration 98 operates. The configuration struct provides the filesystem with the block 106 format a block device or mount the filesystem. 123 [lfs.h](lfs.h), or an error returned by the user's block device operations. 139 At a high level, littlefs is a block based filesystem that uses small logs to 148 common block allocator. By limiting the number of erases allowed on a block 195 [emulated block device](bd/lfs_testbd.h) found in the `bd` directory. 241 which already has block device drivers for most forms of embedded storage. 251 _O(|address|)_ pointer structure stored on each block and in RAM.
|
D | lfs.h | 165 int (*read)(const struct lfs_config *c, lfs_block_t block, 171 int (*prog)(const struct lfs_config *c, lfs_block_t block, 178 int (*erase)(const struct lfs_config *c, lfs_block_t block); 352 lfs_block_t block; member 394 lfs_block_t block; member
|
/littlefs-3.7.0-3.6.0/scripts/ |
D | tracebd.py | 360 def _op(self, f, block=None, off=None, size=None): argument 361 if block is None: 372 count=max(self.count, block+1)) 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 387 self._op(Block.read, block, off, size) 389 def prog(self, block=None, off=None, size=None): argument 390 self._op(Block.prog, block, off, size) 392 def erase(self, block=None, off=None, size=None): argument [all …]
|
D | readmdir.py | 175 self.pair = [MetadataPair([block]) for block in blocks] 188 block = self.data 190 self.rev, = struct.unpack('<I', block[0:4]) 191 crc = binascii.crc32(block[0:4]) 201 while len(block) - off >= 4: 202 ntag, = struct.unpack('>I', block[off:off+4]) 206 tag.data = block[off+4:off+tag.dsize] 208 crc = binascii.crc32(block[off:off+2*4], crc) 210 crc = binascii.crc32(block[off:off+tag.dsize], crc) 229 block[off:off+fcrcsize]) [all …]
|
D | readblock.py | 7 f.seek(args.block * args.block_size) 8 block = (f.read(args.block_size) 13 return sp.run(['xxd', '-g1', '-'], input=block).returncode
|
D | readtree.py | 31 for block in tail: 32 f.seek(block * args.block_size) 35 blocks[id(data[-1])] = block
|