rbd: add doc comment to Discard function

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-02-25 14:40:08 -05:00 committed by John Mulligan
parent d71fb3b2ea
commit 223f1e01d7
1 changed files with 6 additions and 1 deletions

View File

@ -800,7 +800,12 @@ func (image *Image) Seek(offset int64, whence int) (int64, error) {
return image.offset, nil return image.offset, nil
} }
// int rbd_discard(rbd_image_t image, uint64_t ofs, uint64_t len); // Discard the supplied range from the image. The supplied range will be read
// as zeros once Discard returns. The discarded range will no longer take up
// space.
//
// Implements:
// int rbd_discard(rbd_image_t image, uint64_t ofs, uint64_t len);
func (image *Image) Discard(ofs uint64, length uint64) (int, error) { func (image *Image) Discard(ofs uint64, length uint64) (int, error) {
if err := image.validate(imageIsOpen); err != nil { if err := image.validate(imageIsOpen); err != nil {
return 0, err return 0, err