mirror of https://github.com/ceph/go-ceph
rbd: add wrapper for unexported pool stat functions.
Added wrappers for rbd_pool_stats_create() and rbd_pool_stats_destroy() functions. Right now, keeping these unexported. Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
This commit is contained in:
parent
0cd2b21224
commit
fec47ac9a9
|
@ -99,3 +99,30 @@ func PoolInit(ioctx *rados.IOContext, force bool) error {
|
||||||
ret := C.rbd_pool_init(cephIoctx(ioctx), C.bool(force))
|
ret := C.rbd_pool_init(cephIoctx(ioctx), C.bool(force))
|
||||||
return getError(ret)
|
return getError(ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// poolStats represents RBD pool stats variable.
|
||||||
|
type poolStats struct {
|
||||||
|
stats C.rbd_pool_stats_t
|
||||||
|
}
|
||||||
|
|
||||||
|
// poolStatsCreate creates a new poolStats struct.
|
||||||
|
//
|
||||||
|
// Implements:
|
||||||
|
// void rbd_pool_stats_create(rbd_pool_stats_t *stats)
|
||||||
|
func poolStatsCreate() *poolStats {
|
||||||
|
poolstats := &poolStats{}
|
||||||
|
C.rbd_pool_stats_create(&poolstats.stats)
|
||||||
|
return poolstats
|
||||||
|
}
|
||||||
|
|
||||||
|
// destroy a poolStats struct and free the associated resources.
|
||||||
|
//
|
||||||
|
// Implements:
|
||||||
|
// void rbd_pool_stats_destroy(rbd_pool_stats_t stats)
|
||||||
|
func (poolstats *poolStats) destroy() {
|
||||||
|
C.rbd_pool_stats_destroy(poolstats.stats)
|
||||||
|
|
||||||
|
if poolstats.stats != nil {
|
||||||
|
poolstats.stats = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue