mirror of https://github.com/ceph/go-ceph
rbd: document SparsifyWithProgress callback's arguments
As discussed in #851, we wanted to fully document the arguments the callback function is expected to be called with. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
3d986f2bd3
commit
eaf74cbebd
|
@ -27,8 +27,14 @@ import (
|
||||||
// SparsifyCallback defines the function signature needed for the
|
// SparsifyCallback defines the function signature needed for the
|
||||||
// SparsifyWithProgress callback.
|
// SparsifyWithProgress callback.
|
||||||
//
|
//
|
||||||
// This callback will be called by SparsifyWithProgress when it
|
// This callback will be called by SparsifyWithProgress when it wishes to
|
||||||
// wishes to report progress on sparse.
|
// report progress on sparse. The callback function will be called with the
|
||||||
|
// first argument containing the current offset within the image being made
|
||||||
|
// sparse and the second argument containing the total size of the image. The
|
||||||
|
// third argument is an opaque value that is passed to the SparsifyWithProgress
|
||||||
|
// function's data argument and every call to the callback will receive the
|
||||||
|
// same object. The sparsify operation will be aborted if the progress
|
||||||
|
// callback returns a non-zero value.
|
||||||
type SparsifyCallback func(uint64, uint64, interface{}) int
|
type SparsifyCallback func(uint64, uint64, interface{}) int
|
||||||
|
|
||||||
var sparsifyCallbacks = callbacks.New()
|
var sparsifyCallbacks = callbacks.New()
|
||||||
|
|
Loading…
Reference in New Issue