]> git.proxmox.com Git - mirror_zfs.git/commit
tests/block_cloning: rename and document get_same_blocks helper
authorRob N <robn@despairlabs.com>
Fri, 25 Aug 2023 17:31:29 +0000 (03:31 +1000)
committerGitHub <noreply@github.com>
Fri, 25 Aug 2023 17:31:29 +0000 (10:31 -0700)
commit804414aad224b432590afe3f9ec114ffb49e0f13
treee5b1382c1a5a9e96b488b0c38a3d23bc3b974e72
parented39d668ea63e0bbf4e3e4d761a84c7d42ef8f8b
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
tests/zfs-tests/tests/functional/block_cloning/block_cloning.kshlib
tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange.ksh
tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_cross_dataset.ksh
tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback.ksh
tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_fallback_same_txg.ksh
tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_partial.ksh
tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_copyfilerange.ksh
tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlone.ksh
tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange.ksh
tests/zfs-tests/tests/functional/block_cloning/block_cloning_ficlonerange_partial.ksh