Whamcloud - gitweb
LU-13397 lfs: mirror resync to keep sparseness
authorMikhail Pershin <mpershin@whamcloud.com>
Wed, 25 Nov 2020 16:05:05 +0000 (19:05 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 6 Mar 2021 20:33:09 +0000 (20:33 +0000)
commit43982b91a85e54e891db18597bf02a143803b884
tree45d46f65779850bf7cdbdb3b16f7546ce99d77f2
parentd528142f9df76718dc97748e843675bdd63daa26
LU-13397 lfs: mirror resync to keep sparseness

Use SEEK_HOLE/SEEK_DATA in llapi_mirror_resync_many() to
copy just data chunks between components. Holes at the last
component are done with truncate(), holes in other components
are done with fallocate(FALLOC_FL_PUNCH_HOLE). In case of any
punch() error the hole is just copied via read(), i.e. as zeroes

Currently fallocate(FALLOC_FL_PUNCH_HOLE) is not supported yet,
so resync preserves sparseness only for last components

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: Id249739c5cd2d1c8a998da3341d326de1a8b8d32
Reviewed-on: https://review.whamcloud.com/41849
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/lustre/lustreapi.h
lustre/tests/sanity-flr.sh
lustre/utils/liblustreapi_layout.c
lustre/utils/liblustreapi_lseek.c
lustre/utils/liblustreapi_mirror.c