/littlefs-3.5.0-3.4.0/bd/ |
D | lfs_testbd.c | 107 static int lfs_testbd_rawread(const struct lfs_config *cfg, lfs_block_t block, 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() 117 static int lfs_testbd_rawprog(const struct lfs_config *cfg, lfs_block_t block, 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() 128 lfs_block_t block) { in lfs_testbd_rawerase() argument 131 return lfs_filebd_erase(cfg, block); in lfs_testbd_rawerase() 133 return lfs_rambd_erase(cfg, block); in lfs_testbd_rawerase() 147 int lfs_testbd_read(const struct lfs_config *cfg, lfs_block_t block, in lfs_testbd_read() argument [all …]
|
D | lfs_rambd.c | 74 int lfs_rambd_read(const struct lfs_config *cfg, lfs_block_t block, in lfs_rambd_read() argument 78 (void*)cfg, block, off, buffer, size); in lfs_rambd_read() 84 LFS_ASSERT(block < cfg->block_count); in lfs_rambd_read() 87 memcpy(buffer, &bd->buffer[block*cfg->block_size + off], size); in lfs_rambd_read() 93 int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, in lfs_rambd_prog() argument 97 (void*)cfg, block, off, buffer, size); in lfs_rambd_prog() 103 LFS_ASSERT(block < cfg->block_count); in lfs_rambd_prog() 108 LFS_ASSERT(bd->buffer[block*cfg->block_size + off + i] == in lfs_rambd_prog() 114 memcpy(&bd->buffer[block*cfg->block_size + off], buffer, size); in lfs_rambd_prog() 120 int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block) { in lfs_rambd_erase() argument [all …]
|
D | lfs_filebd.c | 81 int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, in lfs_filebd_read() argument 85 (void*)cfg, block, off, buffer, size); in lfs_filebd_read() 91 LFS_ASSERT(block < cfg->block_count); in lfs_filebd_read() 100 (off_t)block*cfg->block_size + (off_t)off, SEEK_SET); in lfs_filebd_read() 118 int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, in lfs_filebd_prog() argument 121 (void*)cfg, block, off, buffer, size); in lfs_filebd_prog() 127 LFS_ASSERT(block < cfg->block_count); in lfs_filebd_prog() 132 (off_t)block*cfg->block_size + (off_t)off, SEEK_SET); in lfs_filebd_prog() 154 (off_t)block*cfg->block_size + (off_t)off, SEEK_SET); in lfs_filebd_prog() 172 int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block) { in lfs_filebd_erase() argument [all …]
|
D | lfs_testbd.h | 108 int lfs_testbd_read(const struct lfs_config *cfg, lfs_block_t block, 114 int lfs_testbd_prog(const struct lfs_config *cfg, lfs_block_t block, 121 int lfs_testbd_erase(const struct lfs_config *cfg, lfs_block_t block); 131 lfs_block_t block); 135 lfs_block_t block, lfs_testbd_wear_t wear);
|
D | lfs_filebd.h | 51 int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, 57 int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, 64 int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block);
|
D | lfs_rambd.h | 53 int lfs_rambd_read(const struct lfs_config *cfg, lfs_block_t block, 59 int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, 66 int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block);
|
/littlefs-3.5.0-3.4.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 | 39 rcache->block = LFS_BLOCK_NULL; in lfs_cache_drop() 45 pcache->block = LFS_BLOCK_NULL; in lfs_cache_zero() 50 lfs_block_t block, lfs_off_t off, in lfs_bd_read() argument 53 if (block >= lfs->cfg->block_count || in lfs_bd_read() 61 if (pcache && block == pcache->block && in lfs_bd_read() 78 if (block == rcache->block && in lfs_bd_read() 99 int err = lfs->cfg->read(lfs->cfg, block, off, data, diff); in lfs_bd_read() 111 LFS_ASSERT(block < lfs->cfg->block_count); in lfs_bd_read() 112 rcache->block = block; in lfs_bd_read() 120 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. 234 which already has block device drivers for most forms of embedded storage. 244 _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); 323 lfs_block_t block; member 365 lfs_block_t block; member
|
/littlefs-3.5.0-3.4.0/scripts/ |
D | readmdir.py | 158 self.pair = [MetadataPair([block]) for block in blocks] 171 block = self.data 173 self.rev, = struct.unpack('<I', block[0:4]) 174 crc = binascii.crc32(block[0:4]) 182 while len(block) - off >= 4: 183 ntag, = struct.unpack('>I', block[off:off+4]) 187 tag.data = block[off+4:off+tag.dsize] 189 crc = binascii.crc32(block[off:off+4+4], crc) 191 crc = binascii.crc32(block[off:off+tag.dsize], crc) 312 for block in [args.block1, args.block2]: [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
|
/littlefs-3.5.0-3.4.0/tests/ |
D | test_move.toml | 97 lfs_block_t block = dir.m.pair[0]; 101 cfg.read(&cfg, block, 0, bbuffer, LFS_BLOCK_SIZE) => 0; 107 cfg.erase(&cfg, block) => 0; 108 cfg.prog(&cfg, block, 0, bbuffer, LFS_BLOCK_SIZE) => 0; 173 lfs_block_t block = dir.m.pair[0]; 177 cfg.read(&cfg, block, 0, bbuffer, LFS_BLOCK_SIZE) => 0; 183 cfg.erase(&cfg, block) => 0; 184 cfg.prog(&cfg, block, 0, bbuffer, LFS_BLOCK_SIZE) => 0; 190 block = dir.m.pair[0]; 193 cfg.read(&cfg, block, 0, bbuffer, LFS_BLOCK_SIZE) => 0; [all …]
|
D | test_orphans.toml | 18 lfs_block_t block = dir.m.pair[0]; 22 cfg.read(&cfg, block, 0, bbuffer, LFS_BLOCK_SIZE) => 0; 28 cfg.erase(&cfg, block) => 0; 29 cfg.prog(&cfg, block, 0, bbuffer, LFS_BLOCK_SIZE) => 0;
|
D | test_alloc.toml | 326 [[case]] # what if we have a bad block during an allocation scan? 363 // but mark the head of our file as a "bad block", this is force our 378 // now reverse the "bad block" and try to write the file again until we 411 # on the geometry of the block device. But they are valuable. Eventually they 493 // create one block hole for half a directory 630 // rewrite one file with a hole of one block
|
D | test_exhaustion.toml | 168 # of wear-leveling is that increasing a block device's space translates directly 169 # into increasing the block devices lifetime. This is something we can actually 431 // 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 | 155 // rewrite block to contain bad pointer
|