HomeFreeBSD

tests/block_cloning: rename and document get_same_blocks helper

Description

tests/block_cloning: rename and document get_same_blocks helper

get_same_blocks is a helper to compare two files and return a list of
the blocks that are clones of each other. Its very necessary for block
cloning tests.

Previously it was incorrectly called unique_blocks, which is the
_inverse_ of what it does (an early version did list unique blocks; it
was changed but the name was not). So if nothing else, it should be
called duplicate_blocks.

But, keeping the details of a clone operation in your head is actually
quite difficult, without the additional overhead of wondering how the
tools work. So I've renamed it to better describe what it does, added a
usage note, and changed it to return block indexes from 0 instead of 1,
to match how L0 blocks are normally counted.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Reviewed-by: Kay Pedersen <mail@mkwg.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #15181

Details

Provenance
rob.norris_klarasystems.comAuthored on Aug 25 2023, 5:31 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Aug 26 2023, 6:18 PM
Parents
rGab999406fedf: Update outdated assertion from zio_write_compress
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG084ff4abd27c: tests/block_cloning: rename and document get_same_blocks helper (authored by Rob N <robn@despairlabs.com>).Aug 26 2023, 6:18 PM