fsx: move range generation logic into a common helper
authorFilipe Manana <fdmanana@suse.com>
Mon, 20 Apr 2020 17:09:31 +0000 (18:09 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 May 2020 12:34:27 +0000 (20:34 +0800)
commitf8ef0a099b0371803578702d54f87f471118ecf5
treea4fdb005997c99995f0f59b93dc2ffcbf7c8ffd1
parente5faa1ef15e48e428b0a62e8aae5e5fd57324c38
fsx: move range generation logic into a common helper

We have very similar code that generates the destination range for clone,
dedupe and copy_file_range operations, so avoid duplicating the code three
times and move it into a helper function.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
ltp/fsx.c