]> git.ipfire.org Git - thirdparty/linux.git/commit
dm-verity-fec: move computation of offset and rsb down a level
authorEric Biggers <ebiggers@kernel.org>
Fri, 6 Feb 2026 04:59:36 +0000 (20:59 -0800)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 9 Mar 2026 14:13:19 +0000 (15:13 +0100)
commitca0da6cc096870e9e138f4c2bb78bd2560e29590
tree68015f9dff0dc146f1e16db1907eca80bc8e0187
parent3ad2b952a3ea26c05ed6fdd6484051604b1dee66
dm-verity-fec: move computation of offset and rsb down a level

verity_fec_decode() computes (offset, rsb) from the target block index
and calls fec_decode_rsb() with these parameters.  Move this computation
into fec_decode_rsb(), and rename fec_decode_rsb() to fec_decode().

This ends up being simpler and enables further refactoring, specifically
making use of the quotient from the division more easily.  The function
renaming also eliminates a reference to the ambiguous term "rsb".

This change does mean the same div64_u64_rem() can now be executed twice
per block, since verity_fec_decode() calls fec_decode() up to twice per
block.  However, this cost is negligible compared to the rest of FEC.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-verity-fec.c