Updated comments to prefer "canonical checksum" for rbyd checksums

I think this describes the goal of the non-perturbed rbyd checksums
decently. At the very least it's less wrong that "data checksum", and
calling it the "metadata checksum" would just be confusing. (Would our
commit checksum be the "metametadata checksum" then?)
This commit is contained in:
Christopher Haster
2024-07-31 12:29:13 -05:00
parent 9a9b3fc161
commit fb73f78c91
6 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -2284,7 +2284,7 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
rbyd->weight = weight;
ecksum = ecksum_;
// revert to data checksum
// revert to canonical checksum
cksum_ = cksum;
ecksum_.cksize = -1;
}
@@ -2311,7 +2311,7 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
// end of trunk?
if (!lfsr_tag_isalt(tag)) {
// update data checksum
// update canonical checksum
cksum = cksum_;
// update trunk and weight, unless we are a shrub trunk
if (!lfsr_tag_isshrub(tag) || trunk__ == trunk) {
@@ -3371,7 +3371,7 @@ static int lfsr_rbyd_appendcksum(lfs_t *lfs, lfsr_rbyd_t *rbyd) {
return err;
}
// save the data checksum
// save the canonical checksum
uint32_t cksum = rbyd->cksum;
// align to the next prog unit
@@ -3501,7 +3501,7 @@ static int lfsr_rbyd_appendcksum(lfs_t *lfs, lfsr_rbyd_t *rbyd) {
= ((lfs_size_t)perturb
<< (8*sizeof(lfs_size_t)-1))
| off_;
// revert to data checksum
// revert to canonical checksum
rbyd->cksum = cksum;
return 0;
}
+1 -1
View File
@@ -713,7 +713,7 @@ class Rbyd:
# end of trunk?
if not tag & TAG_ALT:
# update data checksum
# update canonical checksum
cksum_ = cksum__
# update trunk/weight unless we found a shrub or an
# explicit trunk (which may be a shrub) is requested
+1 -1
View File
@@ -386,7 +386,7 @@ class Rbyd:
# end of trunk?
if not tag & TAG_ALT:
# update data checksum
# update canonical checksum
cksum_ = cksum__
# update trunk/weight unless we found a shrub or an
# explicit trunk (which may be a shrub) is requested
+1 -1
View File
@@ -417,7 +417,7 @@ class Rbyd:
# end of trunk?
if not tag & TAG_ALT:
# update data checksum
# update canonical checksum
cksum_ = cksum__
# update trunk/weight unless we found a shrub or an
# explicit trunk (which may be a shrub) is requested
+1 -1
View File
@@ -401,7 +401,7 @@ class Rbyd:
# end of trunk?
if not tag & TAG_ALT:
# update data checksum
# update canonical checksum
cksum_ = cksum__
# update trunk/weight unless we found a shrub or an
# explicit trunk (which may be a shrub) is requested
+2 -2
View File
@@ -580,7 +580,7 @@ def dbg_log(data, block_size, rev, eoff, weight, *,
upper_ += w
if not tag & TAG_ALT:
# update data checksum
# update canonical checksum
cksum = cksum_
# derive the current tag's rid from alt weights
rid = lower_ + w-1
@@ -997,7 +997,7 @@ def main(disk, blocks=None, *,
# end of trunk?
if not tag & TAG_ALT:
# update data checksum
# update canonical checksum
cksum_ = cksum__
# update trunk/weight unless we found a shrub or an
# explicit trunk (which may be a shrub) is requested