Renamed fcksum -> ecksum

This checksum is used to keep track of if we have erased, and not yet
touched, the unused bytes trailing our current commit in the rbyd.

The working theory is that if any prog attempt is made, it will, most
likely, change the checksum of the contents, allowing littlefs to
determine if trailing erased-state is safe to use, even under powerloss.
littlefs can also perturb future data by a single bit, to force this
checksum to always be invalidated during normal operation.

The original name, "forward erased-state checksums (fcksum)", came from the
idea that the checksum "looks forward" into the next commit.

But after using them for a bit, I think the name is unnecessarily
confusing. It, uh, also looks a lot like a swear word. I think
shortening the name to just "erased-state checksums (ecksum)", even
though the previous name is already in use in  a release, is reasonable.

---

It's probably hard to believe but the name change from fcrc -> ecrc
really was unrelated to the crc -> cksum change. But boy is it
convenient for avoiding an awkward name. A lot of these name changes
involved sed scripts, so I didn't notice how awkward fcksum would be to
use until writing this commit message.
This commit is contained in:
Christopher Haster
2023-08-07 13:43:07 -05:00
parent 7031d6e1b3
commit d2f2b53262
8 changed files with 447 additions and 447 deletions
+4 -4
View File
@@ -348,11 +348,11 @@ typedef struct lfs_cache {
typedef struct lfsr_rbyd {
// note this lines up with weight in lfsr_btree_t
lfs_size_t weight;
// off=0, trunk=0 => not yet committed
// off=0, trunk>0 => not yet fetched
// off>=block_size => rbyd not erased/needs compaction
// eoff=0, trunk=0 => not yet committed
// eoff=0, trunk>0 => not yet fetched
// eoff>=block_size => rbyd not erased/needs compaction
lfs_off_t trunk;
lfs_off_t off;
lfs_off_t eoff;
uint32_t cksum;
// note this lines up with arrays of redundant blocks in lfsr_mdir_t
lfs_block_t block;