Renamed lfsr_btree_update -> lfsr_btree_set
This commit is contained in:
@@ -4153,7 +4153,7 @@ static int lfsr_btree_push(lfs_t *lfs, lfsr_btree_t *btree,
|
||||
}
|
||||
}
|
||||
|
||||
static int lfsr_btree_update(lfs_t *lfs, lfsr_btree_t *btree,
|
||||
static int lfsr_btree_set(lfs_t *lfs, lfsr_btree_t *btree,
|
||||
lfs_size_t bid, lfsr_tag_t tag, lfs_size_t weight, lfsr_data_t data) {
|
||||
LFS_ASSERT(bid < lfsr_btree_weight(btree));
|
||||
LFS_ASSERT(lfsr_btree_weight(btree) > 0);
|
||||
@@ -5119,7 +5119,7 @@ static int lfsr_mtree_split_(lfs_t *lfs, lfsr_btree_t *mtree,
|
||||
return d;
|
||||
}
|
||||
|
||||
err = lfsr_btree_update(lfs, mtree, mid, LFSR_TAG_MDIR, 1,
|
||||
err = lfsr_btree_set(lfs, mtree, mid, LFSR_TAG_MDIR, 1,
|
||||
LFSR_DATA_BUF(buf, d));
|
||||
if (err) {
|
||||
return err;
|
||||
@@ -5137,7 +5137,7 @@ static int lfsr_mtree_split_(lfs_t *lfs, lfsr_btree_t *mtree,
|
||||
return d;
|
||||
}
|
||||
|
||||
err = lfsr_btree_update(lfs, mtree, mid, LFSR_TAG_MDIR, 1,
|
||||
err = lfsr_btree_set(lfs, mtree, mid, LFSR_TAG_MDIR, 1,
|
||||
LFSR_DATA_BUF(buf, d));
|
||||
if (err) {
|
||||
return err;
|
||||
@@ -5160,8 +5160,7 @@ static int lfsr_mtree_split_(lfs_t *lfs, lfsr_btree_t *mtree,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// TODO static
|
||||
int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, lfs_ssize_t *rid,
|
||||
static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, lfs_ssize_t *rid,
|
||||
const lfsr_attr_t *attrs, lfs_size_t attr_count) {
|
||||
LFS_ASSERT(mdir->mid != LFSR_MID_RM);
|
||||
|
||||
@@ -5325,7 +5324,7 @@ int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, lfs_ssize_t *rid,
|
||||
return d;
|
||||
}
|
||||
|
||||
err = lfsr_btree_update(lfs, &mtree_, mdir->mid, LFSR_TAG_MDIR, 1,
|
||||
err = lfsr_btree_set(lfs, &mtree_, mdir->mid, LFSR_TAG_MDIR, 1,
|
||||
LFSR_DATA_BUF(buf, d));
|
||||
if (err) {
|
||||
return err;
|
||||
|
||||
+14
-14
@@ -719,7 +719,7 @@ code = '''
|
||||
lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF("a", 1)) => 0;
|
||||
// update the tree
|
||||
lfsr_btree_update(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
|
||||
lfsr_btree_set(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF("A", 1)) => 0;
|
||||
printf("btree: w%d 0x%x.%x\n",
|
||||
btree.weight,
|
||||
@@ -762,9 +762,9 @@ code = '''
|
||||
lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF("b", 1)) => 0;
|
||||
// update the tree
|
||||
lfsr_btree_update(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
|
||||
lfsr_btree_set(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF("A", 1)) => 0;
|
||||
lfsr_btree_update(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
|
||||
lfsr_btree_set(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF("B", 1)) => 0;
|
||||
printf("btree: w%d 0x%x.%x\n",
|
||||
btree.weight,
|
||||
@@ -815,11 +815,11 @@ code = '''
|
||||
lfsr_btree_push(&lfs, &btree, 2, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF("c", 1)) => 0;
|
||||
// update the tree
|
||||
lfsr_btree_update(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
|
||||
lfsr_btree_set(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF("A", 1)) => 0;
|
||||
lfsr_btree_update(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
|
||||
lfsr_btree_set(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF("B", 1)) => 0;
|
||||
lfsr_btree_update(&lfs, &btree, 2, LFSR_TAG_INLINED, 1,
|
||||
lfsr_btree_set(&lfs, &btree, 2, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF("C", 1)) => 0;
|
||||
printf("btree: w%d 0x%x.%x\n",
|
||||
btree.weight,
|
||||
@@ -887,7 +887,7 @@ code = '''
|
||||
}
|
||||
// update the tree
|
||||
for (lfs_size_t i = 0; i < N; i++) {
|
||||
int err = lfsr_btree_update(&lfs, &btree, i, LFSR_TAG_INLINED, 1,
|
||||
int err = lfsr_btree_set(&lfs, &btree, i, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF(&uppers[i % 26], 1));
|
||||
// ignore space issues
|
||||
if (err == LFS_ERR_NOSPC) {
|
||||
@@ -982,7 +982,7 @@ code = '''
|
||||
lfs_size_t id = TEST_PRNG(&prng) % N;
|
||||
|
||||
// update btree
|
||||
int err = lfsr_btree_update(&lfs, &btree, id, LFSR_TAG_INLINED, 1,
|
||||
int err = lfsr_btree_set(&lfs, &btree, id, LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF(&uppers[i % 26], 1));
|
||||
// ignore space issues
|
||||
if (err == LFS_ERR_NOSPC) {
|
||||
@@ -1065,7 +1065,7 @@ code = '''
|
||||
}
|
||||
// update the tree
|
||||
for (lfs_size_t i = 0; i < N; i++) {
|
||||
int err = lfsr_btree_update(&lfs, &btree, i*W+W-1, LFSR_TAG_INLINED, W,
|
||||
int err = lfsr_btree_set(&lfs, &btree, i*W+W-1, LFSR_TAG_INLINED, W,
|
||||
LFSR_DATA_BUF(&uppers[i % 26], 1));
|
||||
// ignore space issues
|
||||
if (err == LFS_ERR_NOSPC) {
|
||||
@@ -1187,7 +1187,7 @@ code = '''
|
||||
}
|
||||
|
||||
// update btree
|
||||
int err = lfsr_btree_update(&lfs, &btree,
|
||||
int err = lfsr_btree_set(&lfs, &btree,
|
||||
weighted_id+sim_weights[id]-1, LFSR_TAG_INLINED, weight,
|
||||
LFSR_DATA_BUF(&uppers[i % 26], 1));
|
||||
// ignore space issues
|
||||
@@ -2575,7 +2575,7 @@ code = '''
|
||||
|
||||
} else if (op == 1) {
|
||||
// update btree
|
||||
int err = lfsr_btree_update(&lfs, &btree, id,
|
||||
int err = lfsr_btree_set(&lfs, &btree, id,
|
||||
LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF(&alphas[i % 26], 1));
|
||||
// ignore space issues
|
||||
@@ -2716,7 +2716,7 @@ code = '''
|
||||
|
||||
} else if (op == 1) {
|
||||
// update btree
|
||||
int err = lfsr_btree_update(&lfs, &btree,
|
||||
int err = lfsr_btree_set(&lfs, &btree,
|
||||
weighted_id+sim_weights[id]-1, LFSR_TAG_INLINED, weight,
|
||||
LFSR_DATA_BUF(&alphas[i % 26], 1));
|
||||
// ignore space issues
|
||||
@@ -3623,7 +3623,7 @@ code = '''
|
||||
|
||||
} else if (op == 1) {
|
||||
// update btree
|
||||
int err = lfsr_btree_update(&lfs, &btree, id,
|
||||
int err = lfsr_btree_set(&lfs, &btree, id,
|
||||
LFSR_TAG_INLINED, 1,
|
||||
LFSR_DATA_BUF(&nums[i % 10], 1));
|
||||
// ignore space issues
|
||||
@@ -3830,7 +3830,7 @@ code = '''
|
||||
|
||||
} else if (op == 1) {
|
||||
// update btree
|
||||
int err = lfsr_btree_update(&lfs, &btree,
|
||||
int err = lfsr_btree_set(&lfs, &btree,
|
||||
weighted_id+sim_weights[id]-1, LFSR_TAG_INLINED, weight,
|
||||
LFSR_DATA_BUF(&nums[i % 10], 1));
|
||||
// ignore space issues
|
||||
|
||||
Reference in New Issue
Block a user