mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-10-18 21:29:50 +00:00
d05847ee73
Bumps [github.com/ceph/go-ceph](https://github.com/ceph/go-ceph) from 0.20.0 to 0.21.0. - [Release notes](https://github.com/ceph/go-ceph/releases) - [Changelog](https://github.com/ceph/go-ceph/blob/master/docs/release-process.md) - [Commits](https://github.com/ceph/go-ceph/compare/v0.20.0...v0.21.0) --- updated-dependencies: - dependency-name: github.com/ceph/go-ceph dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
37 lines
1009 B
Go
37 lines
1009 B
Go
package rados
|
|
|
|
// #cgo LDFLAGS: -lrados
|
|
// #include <rados/librados.h>
|
|
// #include <stdlib.h>
|
|
//
|
|
import "C"
|
|
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
// SetAllocationHint sets allocation hint for an object. This is an advisory
|
|
// operation, it will always succeed (as if it was submitted with a
|
|
// LIBRADOS_OP_FLAG_FAILOK flag set) and is not guaranteed to do anything on
|
|
// the backend.
|
|
//
|
|
// Implements:
|
|
//
|
|
// int rados_set_alloc_hint2(rados_ioctx_t io,
|
|
// const char *o,
|
|
// uint64_t expected_object_size,
|
|
// uint64_t expected_write_size,
|
|
// uint32_t flags);
|
|
func (ioctx *IOContext) SetAllocationHint(oid string, expectedObjectSize uint64, expectedWriteSize uint64, flags AllocHintFlags) error {
|
|
coid := C.CString(oid)
|
|
defer C.free(unsafe.Pointer(coid))
|
|
|
|
return getError(C.rados_set_alloc_hint2(
|
|
ioctx.ioctx,
|
|
coid,
|
|
(C.uint64_t)(expectedObjectSize),
|
|
(C.uint64_t)(expectedWriteSize),
|
|
(C.uint32_t)(flags),
|
|
))
|
|
}
|