rbd: add function (cc *ClusterConnection) GetTaskAdmin()

This function returns new go-ceph TaskAdmin to add
tasks on rbd volumes.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R
2021-11-16 16:06:18 +05:30
committed by mergify[bot]
parent 420aa9ec57
commit c19264e996
2 changed files with 15 additions and 8 deletions

View File

@ -131,6 +131,16 @@ func (cc *ClusterConnection) GetRBDAdmin() (*ra.RBDAdmin, error) {
return ra.NewFromConn(cc.conn), nil
}
// GetTaskAdmin returns TaskAdmin to add tasks on rbd images.
func (cc *ClusterConnection) GetTaskAdmin() (*ra.TaskAdmin, error) {
rbdAdmin, err := cc.GetRBDAdmin()
if err != nil {
return nil, err
}
return rbdAdmin.Task(), nil
}
// DisableDiscardOnZeroedWriteSame enables the
// `rbd_discard_on_zeroed_write_same` option in the cluster connection, so that
// writing zero blocks of data are actual writes on the OSDs (doing