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