rebase: Make use of latest go ceph library

The go-ceph version 0.4.0 is available now which got some important
library changes required for ceph csi project.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2020-06-17 15:07:06 +05:30
committed by mergify[bot]
parent 306d5b1da0
commit 58bf45a13e
67 changed files with 1133 additions and 362 deletions

View File

@ -35,6 +35,16 @@ func getError(e C.int) error {
return RadosError(e)
}
// getErrorIfNegative converts a ceph return code to error if negative.
// This is useful for functions that return a usable positive value on
// success but a negative error number on error.
func getErrorIfNegative(ret C.int) error {
if ret >= 0 {
return nil
}
return getError(ret)
}
// Public go errors:
var (
@ -61,3 +71,11 @@ const (
// Deprecated: use ErrPermissionDenied instead
RadosErrorPermissionDenied = ErrPermissionDenied
)
// Private errors:
const (
errNameTooLong = RadosError(-C.ENAMETOOLONG)
errRange = RadosError(-C.ERANGE)
)