bcachefs: Erasure coding fixes & refactoring
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 11 Jan 2021 18:51:23 +0000 (13:51 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:51 +0000 (17:08 -0400)
commit2a3731e34de9365038b25d76bb6e11cf5c40ac36
tree2f9ac84593d5caf0c3fd174c7fc1ec71c22008ff
parentb929bbef6f9284350ad3e23a77a822a5bb2fec3d
bcachefs: Erasure coding fixes & refactoring

 - Originally bch_extent_stripe_ptr didn't contain the block index,
   instead we'd have to search through the stripe pointers to figure out
   which pointer matched. When the block field was added to
   bch_extent_stripe_ptr, not all of the code was updated to use it.
   This patch fixes that, and we also now verify that field where it
   makes sense.

 - The ec_stripe_buf_init/exit() functions have been improved, and are
   now used by the bch2_ec_read_extent() (recovery read) path.

 - get_stripe_key() is now used by bch2_ec_read_extent().

 - We now have a getter and setter for checksums within a stripe, like
   we had previously for block sector counts, and ec_generate_checksums
   and ec_validate_checksums are now quite a bit smaller and cleaner.

ec.c still needs a lot of work, but this patch is slowly moving things
in the right direction.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/buckets.c
fs/bcachefs/ec.c
fs/bcachefs/ec.h