rebase: update vendored go-ceph to v0.6

Closes: #1547
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos
2020-10-13 17:22:31 +02:00
committed by mergify[bot]
parent 268c0f1965
commit 29c78f97c0
12 changed files with 286 additions and 40 deletions

View File

@ -101,3 +101,17 @@ func (image *Image) GetModifyTimestamp() (Timespec, error) {
return Timespec(ts.CStructToTimespec(ts.CTimespecPtr(&cts))), nil
}
// Sparsify makes an image sparse by deallocating runs of zeros.
// The sparseSize value will be used to find runs of zeros and must be
// a power of two no less than 4096 and no larger than the image size.
//
// Implements:
// int rbd_sparsify(rbd_image_t image, size_t sparse_size);
func (image *Image) Sparsify(sparseSize uint) error {
if err := image.validate(imageIsOpen); err != nil {
return err
}
return getError(C.rbd_sparsify(image.image, C.size_t(sparseSize)))
}