mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-10-19 05:39:51 +00:00
282c33cb58
The NFS-Admin API has been added to go-ceph v0.15.0. As the API can not be tested in the go-ceph CI, it requires build-tag `ceph_ci_untested`. This additional build-tag has been added to the `Makefile` and should be removed when the API does not require the build-tag anymore. See-also: ceph/go-ceph#655 Signed-off-by: Niels de Vos <ndevos@redhat.com>
32 lines
781 B
Go
32 lines
781 B
Go
//go:build ceph_preview
|
|
// +build ceph_preview
|
|
|
|
package rados
|
|
|
|
// #cgo LDFLAGS: -lrados
|
|
// #include <rados/librados.h>
|
|
// #include <stdlib.h>
|
|
//
|
|
import "C"
|
|
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
// SetLocator sets the key for mapping objects to pgs within an io context.
|
|
// Until a different locator key is set, all objects in this io context will be placed in the same pg.
|
|
// To reset the locator, an empty string must be set.
|
|
// PREVIEW
|
|
//
|
|
// Implements:
|
|
// void rados_ioctx_locator_set_key(rados_ioctx_t io, const char *key);
|
|
func (ioctx *IOContext) SetLocator(locator string) {
|
|
if locator == "" {
|
|
C.rados_ioctx_locator_set_key(ioctx.ioctx, nil)
|
|
} else {
|
|
var cLoc *C.char = C.CString(locator)
|
|
defer C.free(unsafe.Pointer(cLoc))
|
|
C.rados_ioctx_locator_set_key(ioctx.ioctx, cLoc)
|
|
}
|
|
}
|