Renamed lfs_alloc_ack -> lfs_alloc_ckpoint

This name describes this operation ever so slightly better, I've already
been refering to this as "checkpointing the allocator" places.
This commit is contained in:
Christopher Haster
2023-12-06 21:11:11 -06:00
parent 43270ed50f
commit 3a6afaf1c5
5 changed files with 122 additions and 122 deletions
+21 -21
View File
@@ -2016,7 +2016,7 @@ static int lfsr_data_readbptr(lfs_t *lfs, lfsr_data_t *data,
// predeclare block allocator functions
static int lfs_alloc(lfs_t *lfs, lfs_block_t *block);
static void lfs_alloc_ack(lfs_t *lfs);
static void lfs_alloc_ckpoint(lfs_t *lfs);
/// Red-black-yellow Dhara tree operations ///
@@ -8310,11 +8310,11 @@ int lfsr_format(lfs_t *lfs, const struct lfs_config *cfg) {
/// Block allocator ///
// Allocations should call this when all allocated blocks are committed to the
// filesystem, either in the mtree or in tracked mdirs. After an ack, the block
// allocator may realloc any untracked blocks.
static void lfs_alloc_ack(lfs_t *lfs) {
lfs->lookahead.acked = lfs->cfg->block_count;
// Allocations should call this when all allocated blocks are committed to
// the filesystem, either in the mtree or in tracked mdirs. After a
// checkpoint, the block allocator may realloc any untracked blocks.
static void lfs_alloc_ckpoint(lfs_t *lfs) {
lfs->lookahead.ckpoint = lfs->cfg->block_count;
}
static inline void lfs_alloc_setinuse(lfs_t *lfs, lfs_block_t block) {
@@ -8338,10 +8338,10 @@ static int lfs_alloc(lfs_t *lfs, lfs_block_t *block) {
% lfs->cfg->block_count;
// eagerly find next free block to maximize how many blocks
// lfs_alloc_ack makes available for scanning
// lfs_alloc_ckpoint makes available for scanning
while (true) {
lfs->lookahead.next += 1;
lfs->lookahead.acked -= 1;
lfs->lookahead.ckpoint -= 1;
if (lfs->lookahead.next >= lfs->lookahead.size
|| !(lfs->lookahead.buffer[lfs->lookahead.next / 8]
@@ -8352,17 +8352,17 @@ static int lfs_alloc(lfs_t *lfs, lfs_block_t *block) {
}
lfs->lookahead.next += 1;
lfs->lookahead.acked -= 1;
lfs->lookahead.ckpoint -= 1;
}
// In order to keep our block allocator from spinning forever when our
// filesystem is full, we mark points where there are no in-flight
// allocations with an "ack" before starting a set of allocaitons.
// allocations with a checkpoint before starting a set of allocaitons.
//
// If we've looked at all blocks since the last ack, we report the
// filesystem as out of storage.
// If we've looked at all blocks since the last checkpoint, we report
// the filesystem as out of storage.
//
if (lfs->lookahead.acked <= 0) {
if (lfs->lookahead.ckpoint <= 0) {
LFS_ERROR("No more free space 0x%"PRIx32,
(lfs->lookahead.start + lfs->lookahead.next)
% lfs->cfg->block_count);
@@ -8373,13 +8373,13 @@ static int lfs_alloc(lfs_t *lfs, lfs_block_t *block) {
// unused blocks in the next lookahead window.
//
// note we limit the lookahead window to at most the amount of blocks
// acked, this prevents the above math from underflowing
// checkpointed, this prevents the above math from underflowing
//
lfs->lookahead.start += lfs->lookahead.size;
lfs->lookahead.next = 0;
lfs->lookahead.size = lfs_min32(
8*lfs->cfg->lookahead_size,
lfs->lookahead.acked);
lfs->lookahead.ckpoint);
memset(lfs->lookahead.buffer, 0, lfs->cfg->lookahead_size);
// traverse the filesystem, building up knowledge of what blocks are
@@ -8533,7 +8533,7 @@ static int lfsr_fs_fixorphans(lfs_t *lfs) {
static int lfsr_fs_preparemutation(lfs_t *lfs) {
// checkpoint the allocator
lfs_alloc_ack(lfs);
lfs_alloc_ckpoint(lfs);
// fix pending grms
bool pl = false;
@@ -8548,7 +8548,7 @@ static int lfsr_fs_preparemutation(lfs_t *lfs) {
// checkpoint the allocator again since fixgrm completed
// some work
lfs_alloc_ack(lfs);
lfs_alloc_ckpoint(lfs);
}
// fix orphaned mdirs
@@ -8568,7 +8568,7 @@ static int lfsr_fs_preparemutation(lfs_t *lfs) {
// checkpoint the allocator again since fixorphans completed
// some work
lfs_alloc_ack(lfs);
lfs_alloc_ckpoint(lfs);
}
if (pl) {
@@ -10287,7 +10287,7 @@ lfs_ssize_t lfsr_file_write(lfs_t *lfs, lfsr_file_t *file,
int err;
// checkpoint the allocator
lfs_alloc_ack(lfs);
lfs_alloc_ckpoint(lfs);
// update pos if we are appending
if (lfsr_o_isappend(file->flags)) {
@@ -10400,7 +10400,7 @@ int lfsr_file_sync(lfs_t *lfs, lfsr_file_t *file) {
// TODO is this the right place for this?
// checkpoint the allocator
lfs_alloc_ack(lfs);
lfs_alloc_ckpoint(lfs);
// does buffer contain the entire file? we can create a simple
// inlined file in that case
@@ -14116,7 +14116,7 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
lfs->lookahead.start = 0;
lfs->lookahead.size = 0;
lfs->lookahead.next = 0;
lfs->lookahead.acked = 0;
lfs->lookahead.ckpoint = 0;
// check that the size limits are sane
LFS_ASSERT(lfs->cfg->name_limit <= LFS_NAME_MAX);
+1 -1
View File
@@ -601,7 +601,7 @@ typedef struct lfs {
lfs_block_t start;
lfs_block_t size;
lfs_block_t next;
lfs_block_t acked;
lfs_block_t ckpoint;
uint8_t *buffer;
} lookahead;
+3 -3
View File
@@ -23,7 +23,7 @@ code = '''
lfsr_mount(&lfs, CFG) => 0;
// start allocating
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
lfs_size_t alloced = 0;
while (true) {
lfs_block_t block;
@@ -56,7 +56,7 @@ code = '''
lfsr_mount(&lfs, CFG) => 0;
// start allocating
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
lfs_size_t alloced = 0;
while (true) {
lfs_block_t block;
@@ -78,7 +78,7 @@ code = '''
assert(alloced == BLOCK_COUNT-2);
// ack again, effectively releasing all the previously alloced blocks
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
alloced = 0;
while (true) {
lfs_block_t block;
+50 -50
View File
@@ -113,7 +113,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an empty tree
lfsr_btree_t btree;
@@ -145,7 +145,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a single-entry tree
lfsr_btree_t btree;
@@ -185,7 +185,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a two-entry tree
lfsr_btree_t btree;
@@ -232,7 +232,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a two-entry tree
lfsr_btree_t btree;
@@ -280,7 +280,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a two-entry tree
lfsr_btree_t btree;
@@ -335,7 +335,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a two-entry tree
lfsr_btree_t btree;
@@ -393,7 +393,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -446,7 +446,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -502,7 +502,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -586,7 +586,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -659,7 +659,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -798,7 +798,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a single-entry tree
lfsr_btree_t btree;
@@ -840,7 +840,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a two-entry tree
lfsr_btree_t btree;
@@ -892,7 +892,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a two-entry tree
lfsr_btree_t btree;
@@ -955,7 +955,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -1030,7 +1030,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -1125,7 +1125,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -1216,7 +1216,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -1366,7 +1366,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a single-entry tree
lfsr_btree_t btree;
@@ -1420,7 +1420,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a single-entry tree
lfsr_btree_t btree;
@@ -1488,7 +1488,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a single-entry tree
lfsr_btree_t btree;
@@ -1556,7 +1556,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a single-entry tree
lfsr_btree_t btree;
@@ -1641,7 +1641,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -1733,7 +1733,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -1827,7 +1827,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -1925,7 +1925,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -2046,7 +2046,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -2206,7 +2206,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -2266,7 +2266,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -2355,7 +2355,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -2416,7 +2416,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -2590,7 +2590,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree
lfsr_btree_t btree;
@@ -2653,7 +2653,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree
lfsr_btree_t btree;
@@ -2719,7 +2719,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree
lfsr_btree_t btree;
@@ -2780,7 +2780,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree
lfsr_btree_t btree;
@@ -2853,7 +2853,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -2971,7 +2971,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -3143,7 +3143,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a zero-entry tree
lfsr_btree_t btree;
@@ -3177,7 +3177,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a single-entry tree
lfsr_btree_t btree;
@@ -3229,7 +3229,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a two-entry tree
lfsr_btree_t btree;
@@ -3293,7 +3293,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a two-entry tree
lfsr_btree_t btree;
@@ -3369,7 +3369,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a two-entry tree
lfsr_btree_t btree;
@@ -3446,7 +3446,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -3520,7 +3520,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -3633,7 +3633,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -3708,7 +3708,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -3862,7 +3862,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -4032,7 +4032,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
@@ -4245,7 +4245,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a tree with N elements
lfsr_btree_t btree;
@@ -4371,7 +4371,7 @@ code = '''
lfs.lookahead.size = lfs_min(8*CFG->lookahead_size,
CFG->block_count);
lfs.lookahead.next = 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create a btree
lfsr_btree_t btree;
+47 -47
View File
@@ -38,7 +38,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
for (lfs_size_t i = 0; i < N; i++) {
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -77,7 +77,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
for (lfs_size_t i = 0; i < N; i++) {
// force mroot to compact
@@ -119,7 +119,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
for (lfs_size_t i = 0; i < N; i++) {
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -161,7 +161,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with a large attr so the next entry can not fit
uint8_t buffer[SIZE];
@@ -232,7 +232,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -302,7 +302,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -401,7 +401,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create entries
lfsr_mdir_t mdir;
@@ -501,7 +501,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// at least keep track of the number of entries we expect
lfs_size_t count = 0;
@@ -620,7 +620,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -686,7 +686,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -755,7 +755,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -811,7 +811,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -903,7 +903,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -994,7 +994,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -1073,7 +1073,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// at least keep track of the number of entries we expect
lfs_size_t count = 0;
@@ -1218,7 +1218,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with a large attr so the next entry can not fit
uint8_t buffer[SIZE];
@@ -1310,7 +1310,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -1401,7 +1401,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -1492,7 +1492,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with an attr
uint8_t buffer[SIZE];
@@ -1548,7 +1548,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with an attr
uint8_t buffer[SIZE];
@@ -1603,7 +1603,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with an attr
uint8_t buffer[SIZE];
@@ -1667,7 +1667,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with a large attr so the next entry can not fit
uint8_t buffer[SIZE];
@@ -1770,7 +1770,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -1880,7 +1880,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -1959,7 +1959,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// force mroot to compact once, so the second compact below will trigger
// a relocation
@@ -2044,7 +2044,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// force mroot to compact once, so the second compact below will trigger
// a relocation
@@ -2131,7 +2131,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// at least keep track of the number of entries we expect
lfs_size_t count = 0;
@@ -2284,7 +2284,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// setup our neighbors
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -2331,7 +2331,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// setup our neighbors
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -2371,7 +2371,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// setup our neighbors
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -2413,7 +2413,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// setup our neighbors
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -2490,7 +2490,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// setup our neighbors
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -2562,7 +2562,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -2663,7 +2663,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// setup our neighbors
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -2726,7 +2726,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create an uninlined mdir
uint8_t buffer[SIZE];
@@ -2818,7 +2818,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
//// create a situation where we have 3 mdirs in our tree
@@ -2910,7 +2910,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
//// create a situation where we have 3 mdirs in our tree
@@ -2998,7 +2998,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// insert a new entry, this should update our neighbors
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -3089,7 +3089,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with a large attr so the next entry can not fit
uint8_t buffer[SIZE];
@@ -3213,7 +3213,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -3341,7 +3341,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with an attr
uint8_t buffer[SIZE];
@@ -3447,7 +3447,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create entries
lfsr_mdir_t mdir;
@@ -3599,7 +3599,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// at least keep track of the number of entries we expect
lfs_size_t count = 0;
@@ -3769,7 +3769,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
uint8_t buf[LFSR_MPTR_DSIZE];
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -3843,7 +3843,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with an attr
uint8_t buffer[SIZE];
@@ -3897,7 +3897,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// prepare mroot with an attr
uint8_t buffer[SIZE];
@@ -3954,7 +3954,7 @@ code = '''
lfs_t lfs;
lfsr_format(&lfs, CFG) => 0;
lfsr_mount(&lfs, CFG) => 0;
lfs_alloc_ack(&lfs);
lfs_alloc_ckpoint(&lfs);
// create entries
lfsr_mdir_t mdir;