mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: update go-ceph version to v0.11.0
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
87beaac25b
commit
56ac143450
22
vendor/github.com/ceph/go-ceph/rados/rados.go
generated
vendored
22
vendor/github.com/ceph/go-ceph/rados/rados.go
generated
vendored
@ -55,9 +55,9 @@ const (
|
||||
// Version returns the major, minor, and patch components of the version of
|
||||
// the RADOS library linked against.
|
||||
func Version() (int, int, int) {
|
||||
var c_major, c_minor, c_patch C.int
|
||||
C.rados_version(&c_major, &c_minor, &c_patch)
|
||||
return int(c_major), int(c_minor), int(c_patch)
|
||||
var cMajor, cMinor, cPatch C.int
|
||||
C.rados_version(&cMajor, &cMinor, &cPatch)
|
||||
return int(cMajor), int(cMinor), int(cPatch)
|
||||
}
|
||||
|
||||
func makeConn() *Conn {
|
||||
@ -85,22 +85,22 @@ func NewConn() (*Conn, error) {
|
||||
// NewConnWithUser creates a new connection object with a custom username.
|
||||
// It returns the connection and an error, if any.
|
||||
func NewConnWithUser(user string) (*Conn, error) {
|
||||
c_user := C.CString(user)
|
||||
defer C.free(unsafe.Pointer(c_user))
|
||||
return newConn(c_user)
|
||||
cUser := C.CString(user)
|
||||
defer C.free(unsafe.Pointer(cUser))
|
||||
return newConn(cUser)
|
||||
}
|
||||
|
||||
// NewConnWithClusterAndUser creates a new connection object for a specific cluster and username.
|
||||
// It returns the connection and an error, if any.
|
||||
func NewConnWithClusterAndUser(clusterName string, userName string) (*Conn, error) {
|
||||
c_cluster_name := C.CString(clusterName)
|
||||
defer C.free(unsafe.Pointer(c_cluster_name))
|
||||
cClusterName := C.CString(clusterName)
|
||||
defer C.free(unsafe.Pointer(cClusterName))
|
||||
|
||||
c_name := C.CString(userName)
|
||||
defer C.free(unsafe.Pointer(c_name))
|
||||
cName := C.CString(userName)
|
||||
defer C.free(unsafe.Pointer(cName))
|
||||
|
||||
conn := makeConn()
|
||||
ret := C.rados_create2(&conn.cluster, c_cluster_name, c_name, 0)
|
||||
ret := C.rados_create2(&conn.cluster, cClusterName, cName, 0)
|
||||
if ret != 0 {
|
||||
return nil, getError(ret)
|
||||
}
|
||||
|
Reference in New Issue
Block a user