rbd: add doc comments for ReadAt and WriteAt

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-02-25 14:42:36 -05:00 committed by John Mulligan
parent 223f1e01d7
commit 51e9a080bb
1 changed files with 2 additions and 0 deletions

View File

@ -819,6 +819,7 @@ func (image *Image) Discard(ofs uint64, length uint64) (int, error) {
return int(ret), nil return int(ret), nil
} }
// ReadAt copies data from the image into the supplied buffer.
func (image *Image) ReadAt(data []byte, off int64) (int, error) { func (image *Image) ReadAt(data []byte, off int64) (int, error) {
if err := image.validate(imageIsOpen); err != nil { if err := image.validate(imageIsOpen); err != nil {
return 0, err return 0, err
@ -845,6 +846,7 @@ func (image *Image) ReadAt(data []byte, off int64) (int, error) {
return ret, nil return ret, nil
} }
// WriteAt copies data from the supplied buffer to the image.
func (image *Image) WriteAt(data []byte, off int64) (n int, err error) { func (image *Image) WriteAt(data []byte, off int64) (n int, err error) {
if err := image.validate(imageIsOpen); err != nil { if err := image.validate(imageIsOpen); err != nil {
return 0, err return 0, err