Renamed lfsr_opened_* -> lfsr_omdir_*

Been leaning towards this naming scheme. Now lfsr_omdir_* functions
match the lfsr_omdir_t type they operate on.

- Renamed lfs.opened -> lfs.omdirs
- Renamed lfsr_opened_isopen -> lfsr_omdir_isopen
- Renamed lfsr_opened_add -> lfsr_omdir_open
- Renamed lfsr_opened_remove -> lfsr_omdir_close
- Renamed lfsr_mid_isopen -> lfsr_omdir_ismidopen
This commit is contained in:
Christopher Haster
2024-06-21 12:59:18 -05:00
parent 98146d8105
commit e84d2afd60
3 changed files with 121 additions and 120 deletions
+40 -40
View File
@@ -2604,7 +2604,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "c", 1,
@@ -2612,7 +2612,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0c", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// insert a new entry, this should update our neighbors
lfsr_mdir_t mdir;
@@ -2643,8 +2643,8 @@ code = '''
assert(right.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(right.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''
@@ -2663,7 +2663,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "b", 1,
@@ -2671,7 +2671,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0b", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// try removing left neighbor
lfsr_mdir_t mdir;
@@ -2693,8 +2693,8 @@ code = '''
assert(right.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(right.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''
@@ -2713,7 +2713,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "b", 1,
@@ -2721,7 +2721,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0b", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// try removing right neighbor
lfsr_mdir_t mdir;
@@ -2743,8 +2743,8 @@ code = '''
assert(left.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(left.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''
@@ -2765,7 +2765,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "d", 1,
@@ -2773,7 +2773,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0d", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -2816,8 +2816,8 @@ code = '''
assert(right.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(right.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''
@@ -2838,7 +2838,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "e", 1,
@@ -2846,7 +2846,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0e", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -2901,8 +2901,8 @@ code = '''
assert(right.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(right.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''
@@ -2923,7 +2923,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "b", 1,
@@ -2931,7 +2931,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0b", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
@@ -2957,8 +2957,8 @@ code = '''
assert(right.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(right.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''
@@ -2981,7 +2981,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "d", 1,
@@ -2989,7 +2989,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0d", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -3046,8 +3046,8 @@ code = '''
assert(right.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(right.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''
@@ -3070,7 +3070,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "d", 1,
@@ -3078,7 +3078,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0d", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -3135,8 +3135,8 @@ code = '''
assert(right.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(right.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''
@@ -3157,7 +3157,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "f", 1,
@@ -3165,7 +3165,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0f", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -3237,8 +3237,8 @@ code = '''
assert(right.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(right.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''
@@ -3259,7 +3259,7 @@ code = '''
lfsr_mdir_commit(&lfs, &left.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0a", 2)))) => 0;
assert(left.mdir.rbyd.weight == 2);
lfsr_opened_add(&lfs, &left);
lfsr_omdir_open(&lfs, &left);
lfsr_omdir_t right = {.type=0};
lfsr_mtree_namelookup(&lfs, 0, "e", 1,
@@ -3267,7 +3267,7 @@ code = '''
lfsr_mdir_commit(&lfs, &right.mdir, LFSR_ATTRS(
LFSR_ATTR(LFSR_TAG_REG, +1, LFSR_DATA_BUF("\0e", 2)))) => 0;
assert(right.mdir.rbyd.weight == 3);
lfsr_opened_add(&lfs, &right);
lfsr_omdir_open(&lfs, &right);
// create 2 large entries that needs to be uninlined and split
uint8_t buffer[SIZE];
@@ -3332,8 +3332,8 @@ code = '''
assert(right.mdir.rbyd.trunk == mdir.rbyd.trunk);
assert(right.mdir.rbyd.cksum == mdir.rbyd.cksum);
lfsr_opened_remove(&lfs, &left);
lfsr_opened_remove(&lfs, &right);
lfsr_omdir_close(&lfs, &left);
lfsr_omdir_close(&lfs, &right);
lfsr_unmount(&lfs) => 0;
'''