mirror of https://github.com/ceph/go-ceph
rbd: add Image.GetModifyTimestamp()
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
048ed11e63
commit
491f7827a8
|
@ -83,3 +83,21 @@ func (image *Image) GetAccessTimestamp() (Timespec, error) {
|
|||
|
||||
return Timespec(ts.CStructToTimespec(ts.CTimespecPtr(&cts))), nil
|
||||
}
|
||||
|
||||
// GetModifyTimestamp returns the time the rbd image was last modified.
|
||||
//
|
||||
// Implements:
|
||||
// int rbd_get_modify_timestamp(rbd_image_t image, struct timespec *timestamp);
|
||||
func (image *Image) GetModifyTimestamp() (Timespec, error) {
|
||||
if err := image.validate(imageIsOpen); err != nil {
|
||||
return Timespec{}, err
|
||||
}
|
||||
|
||||
var cts C.struct_timespec
|
||||
|
||||
if ret := C.rbd_get_modify_timestamp(image.image, &cts); ret < 0 {
|
||||
return Timespec{}, getError(ret)
|
||||
}
|
||||
|
||||
return Timespec(ts.CStructToTimespec(ts.CTimespecPtr(&cts))), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue