mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-02-22 18:19:29 +00:00
rebase: bump github.com/ceph/go-ceph from 0.31.0 to 0.32.0
Bumps [github.com/ceph/go-ceph](https://github.com/ceph/go-ceph) from 0.31.0 to 0.32.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.31.0...v0.32.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>
This commit is contained in:
parent
280002f0cc
commit
e3e6caf83e
2
go.mod
2
go.mod
@ -9,7 +9,7 @@ require (
|
|||||||
github.com/aws/aws-sdk-go v1.55.6
|
github.com/aws/aws-sdk-go v1.55.6
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.33.14
|
github.com/aws/aws-sdk-go-v2/service/sts v1.33.14
|
||||||
github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000
|
github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000
|
||||||
github.com/ceph/go-ceph v0.31.0
|
github.com/ceph/go-ceph v0.32.0
|
||||||
github.com/container-storage-interface/spec v1.11.0
|
github.com/container-storage-interface/spec v1.11.0
|
||||||
github.com/csi-addons/spec v0.2.1-0.20241104111131-27825f744db5
|
github.com/csi-addons/spec v0.2.1-0.20241104111131-27825f744db5
|
||||||
github.com/gemalto/kmip-go v0.0.10
|
github.com/gemalto/kmip-go v0.0.10
|
||||||
|
4
go.sum
4
go.sum
@ -1451,8 +1451,8 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY
|
|||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
|
github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
|
||||||
github.com/ceph/go-ceph v0.31.0 h1:3yqMVsRN89VyMhJ+qiF91mQHw4RBjbWVVERGX7bYxkk=
|
github.com/ceph/go-ceph v0.32.0 h1:iXRUGdPmH7h9Vf/WA1Dg3Wo1tgL7gcUbylfpbxrlGLs=
|
||||||
github.com/ceph/go-ceph v0.31.0/go.mod h1:VnMYp08oE2o2of29p/oGkxnM8VNF/+LJyVQ5pZSj3Wg=
|
github.com/ceph/go-ceph v0.32.0/go.mod h1:42eoJzyLS3VREzqrg2ot44NtuluQZi55hFRSoLF36GQ=
|
||||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
|
10
vendor/github.com/ceph/go-ceph/internal/retry/sizer.go
generated
vendored
10
vendor/github.com/ceph/go-ceph/internal/retry/sizer.go
generated
vendored
@ -43,13 +43,13 @@ type SizeFunc func(size int) (hint Hint)
|
|||||||
// DoubleSize or indicating a size not greater than the current size, the size
|
// DoubleSize or indicating a size not greater than the current size, the size
|
||||||
// is doubled. If the hint or next size is greater than the max size, the max
|
// is doubled. If the hint or next size is greater than the max size, the max
|
||||||
// size is used for a last retry.
|
// size is used for a last retry.
|
||||||
func WithSizes(size int, max int, f SizeFunc) {
|
func WithSizes(size int, maxSize int, f SizeFunc) {
|
||||||
if size > max {
|
if size > maxSize {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
hint := f(size)
|
hint := f(size)
|
||||||
if hint == nil || size == max {
|
if hint == nil || size == maxSize {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if hint.size() > size {
|
if hint.size() > size {
|
||||||
@ -57,8 +57,8 @@ func WithSizes(size int, max int, f SizeFunc) {
|
|||||||
} else {
|
} else {
|
||||||
size *= 2
|
size *= 2
|
||||||
}
|
}
|
||||||
if size > max {
|
if size > maxSize {
|
||||||
size = max
|
size = maxSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
vendor/github.com/ceph/go-ceph/rbd/encryption.go
generated
vendored
4
vendor/github.com/ceph/go-ceph/rbd/encryption.go
generated
vendored
@ -64,7 +64,7 @@ func (opts EncryptionOptionsLUKS1) allocateEncryptionOptions() cEncryptionData {
|
|||||||
var cOpts C.rbd_encryption_luks1_format_options_t
|
var cOpts C.rbd_encryption_luks1_format_options_t
|
||||||
var retData cEncryptionData
|
var retData cEncryptionData
|
||||||
cOpts.alg = C.rbd_encryption_algorithm_t(opts.Alg)
|
cOpts.alg = C.rbd_encryption_algorithm_t(opts.Alg)
|
||||||
//CBytes allocates memory which we'll free by calling cOptsFree()
|
// CBytes allocates memory. it will be freed when cEncryptionData.free is called
|
||||||
cOpts.passphrase = (*C.char)(C.CBytes(opts.Passphrase))
|
cOpts.passphrase = (*C.char)(C.CBytes(opts.Passphrase))
|
||||||
cOpts.passphrase_size = C.size_t(len(opts.Passphrase))
|
cOpts.passphrase_size = C.size_t(len(opts.Passphrase))
|
||||||
retData.opts = C.rbd_encryption_options_t(&cOpts)
|
retData.opts = C.rbd_encryption_options_t(&cOpts)
|
||||||
@ -78,7 +78,7 @@ func (opts EncryptionOptionsLUKS2) allocateEncryptionOptions() cEncryptionData {
|
|||||||
var cOpts C.rbd_encryption_luks2_format_options_t
|
var cOpts C.rbd_encryption_luks2_format_options_t
|
||||||
var retData cEncryptionData
|
var retData cEncryptionData
|
||||||
cOpts.alg = C.rbd_encryption_algorithm_t(opts.Alg)
|
cOpts.alg = C.rbd_encryption_algorithm_t(opts.Alg)
|
||||||
//CBytes allocates memory which we'll free by calling cOptsFree()
|
// CBytes allocates memory. it will be freed when cEncryptionData.free is called
|
||||||
cOpts.passphrase = (*C.char)(C.CBytes(opts.Passphrase))
|
cOpts.passphrase = (*C.char)(C.CBytes(opts.Passphrase))
|
||||||
cOpts.passphrase_size = C.size_t(len(opts.Passphrase))
|
cOpts.passphrase_size = C.size_t(len(opts.Passphrase))
|
||||||
retData.opts = C.rbd_encryption_options_t(&cOpts)
|
retData.opts = C.rbd_encryption_options_t(&cOpts)
|
||||||
|
105
vendor/github.com/ceph/go-ceph/rbd/encryption_load2.go
generated
vendored
Normal file
105
vendor/github.com/ceph/go-ceph/rbd/encryption_load2.go
generated
vendored
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
//go:build !octopus && !pacific && !quincy && ceph_preview
|
||||||
|
|
||||||
|
package rbd
|
||||||
|
|
||||||
|
// #cgo LDFLAGS: -lrbd
|
||||||
|
// /* force XSI-complaint strerror_r() */
|
||||||
|
// #define _POSIX_C_SOURCE 200112L
|
||||||
|
// #undef _GNU_SOURCE
|
||||||
|
// #include <stdlib.h>
|
||||||
|
// #include <errno.h>
|
||||||
|
// #include <rbd/librbd.h>
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
import (
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
type encryptionOptions2 interface {
|
||||||
|
EncryptionOptions
|
||||||
|
writeEncryptionSpec(spec *C.rbd_encryption_spec_t) func()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (opts EncryptionOptionsLUKS1) writeEncryptionSpec(spec *C.rbd_encryption_spec_t) func() {
|
||||||
|
/* only C memory should be attached to spec */
|
||||||
|
cPassphrase := (*C.char)(C.CBytes(opts.Passphrase))
|
||||||
|
cOptsSize := C.size_t(C.sizeof_rbd_encryption_luks1_format_options_t)
|
||||||
|
cOpts := (*C.rbd_encryption_luks1_format_options_t)(C.malloc(cOptsSize))
|
||||||
|
cOpts.alg = C.rbd_encryption_algorithm_t(opts.Alg)
|
||||||
|
cOpts.passphrase = cPassphrase
|
||||||
|
cOpts.passphrase_size = C.size_t(len(opts.Passphrase))
|
||||||
|
|
||||||
|
spec.format = C.RBD_ENCRYPTION_FORMAT_LUKS1
|
||||||
|
spec.opts = C.rbd_encryption_options_t(cOpts)
|
||||||
|
spec.opts_size = cOptsSize
|
||||||
|
return func() {
|
||||||
|
C.free(unsafe.Pointer(cOpts.passphrase))
|
||||||
|
C.free(unsafe.Pointer(cOpts))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (opts EncryptionOptionsLUKS2) writeEncryptionSpec(spec *C.rbd_encryption_spec_t) func() {
|
||||||
|
/* only C memory should be attached to spec */
|
||||||
|
cPassphrase := (*C.char)(C.CBytes(opts.Passphrase))
|
||||||
|
cOptsSize := C.size_t(C.sizeof_rbd_encryption_luks2_format_options_t)
|
||||||
|
cOpts := (*C.rbd_encryption_luks2_format_options_t)(C.malloc(cOptsSize))
|
||||||
|
cOpts.alg = C.rbd_encryption_algorithm_t(opts.Alg)
|
||||||
|
cOpts.passphrase = cPassphrase
|
||||||
|
cOpts.passphrase_size = C.size_t(len(opts.Passphrase))
|
||||||
|
|
||||||
|
spec.format = C.RBD_ENCRYPTION_FORMAT_LUKS2
|
||||||
|
spec.opts = C.rbd_encryption_options_t(cOpts)
|
||||||
|
spec.opts_size = cOptsSize
|
||||||
|
return func() {
|
||||||
|
C.free(unsafe.Pointer(cOpts.passphrase))
|
||||||
|
C.free(unsafe.Pointer(cOpts))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// EncryptionLoad2 enables IO on an open encrypted image. Multiple encryption
|
||||||
|
// option values can be passed to this call in a slice. For more information
|
||||||
|
// about how items in the slice are applied to images, and possibly ancestor
|
||||||
|
// images refer to the documentation in the C api for rbd_encryption_load2.
|
||||||
|
//
|
||||||
|
// Implements:
|
||||||
|
//
|
||||||
|
// int rbd_encryption_load2(rbd_image_t image,
|
||||||
|
// const rbd_encryption_spec_t *specs,
|
||||||
|
// size_t spec_count);
|
||||||
|
func (image *Image) EncryptionLoad2(opts []EncryptionOptions) error {
|
||||||
|
if image.image == nil {
|
||||||
|
return ErrImageNotOpen
|
||||||
|
}
|
||||||
|
for _, o := range opts {
|
||||||
|
if _, ok := o.(encryptionOptions2); !ok {
|
||||||
|
// this should not happen unless someone adds a new type
|
||||||
|
// implementing EncryptionOptions but fails to add a
|
||||||
|
// writeEncryptionSpec such that the type is not also implementing
|
||||||
|
// encryptionOptions2.
|
||||||
|
return getError(C.EINVAL)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
length := len(opts)
|
||||||
|
cspecs := (*C.rbd_encryption_spec_t)(C.malloc(
|
||||||
|
C.size_t(C.sizeof_rbd_encryption_spec_t * length)))
|
||||||
|
specs := unsafe.Slice(cspecs, length)
|
||||||
|
freeFuncs := make([]func(), length)
|
||||||
|
|
||||||
|
for idx, option := range opts {
|
||||||
|
f := option.(encryptionOptions2).writeEncryptionSpec(&specs[idx])
|
||||||
|
freeFuncs[idx] = f
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
for _, f := range freeFuncs {
|
||||||
|
f()
|
||||||
|
}
|
||||||
|
C.free(unsafe.Pointer(cspecs))
|
||||||
|
}()
|
||||||
|
|
||||||
|
ret := C.rbd_encryption_load2(
|
||||||
|
image.image,
|
||||||
|
cspecs,
|
||||||
|
C.size_t(length))
|
||||||
|
return getError(ret)
|
||||||
|
}
|
51
vendor/github.com/ceph/go-ceph/rbd/encryption_opt_luks.go
generated
vendored
Normal file
51
vendor/github.com/ceph/go-ceph/rbd/encryption_opt_luks.go
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
//go:build !octopus && !pacific && !quincy && ceph_preview
|
||||||
|
|
||||||
|
package rbd
|
||||||
|
|
||||||
|
// #cgo LDFLAGS: -lrbd
|
||||||
|
// /* force XSI-complaint strerror_r() */
|
||||||
|
// #define _POSIX_C_SOURCE 200112L
|
||||||
|
// #undef _GNU_SOURCE
|
||||||
|
// #include <stdlib.h>
|
||||||
|
// #include <rbd/librbd.h>
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
import (
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EncryptionOptionsLUKS generic options for either LUKS v1 or v2. May only be
|
||||||
|
// used for opening existing images - not valid for the EncryptionFormat call.
|
||||||
|
type EncryptionOptionsLUKS struct {
|
||||||
|
Passphrase []byte
|
||||||
|
}
|
||||||
|
|
||||||
|
func (opts EncryptionOptionsLUKS) allocateEncryptionOptions() cEncryptionData {
|
||||||
|
var cOpts C.rbd_encryption_luks_format_options_t
|
||||||
|
var retData cEncryptionData
|
||||||
|
// CBytes allocates memory. it will be freed when cEncryptionData.free is called
|
||||||
|
cOpts.passphrase = (*C.char)(C.CBytes(opts.Passphrase))
|
||||||
|
cOpts.passphrase_size = C.size_t(len(opts.Passphrase))
|
||||||
|
retData.opts = C.rbd_encryption_options_t(&cOpts)
|
||||||
|
retData.optsSize = C.size_t(C.sizeof_rbd_encryption_luks_format_options_t)
|
||||||
|
retData.free = func() { C.free(unsafe.Pointer(cOpts.passphrase)) }
|
||||||
|
retData.format = C.RBD_ENCRYPTION_FORMAT_LUKS
|
||||||
|
return retData
|
||||||
|
}
|
||||||
|
|
||||||
|
func (opts EncryptionOptionsLUKS) writeEncryptionSpec(spec *C.rbd_encryption_spec_t) func() {
|
||||||
|
/* only C memory should be attached to spec */
|
||||||
|
cPassphrase := (*C.char)(C.CBytes(opts.Passphrase))
|
||||||
|
cOptsSize := C.size_t(C.sizeof_rbd_encryption_luks_format_options_t)
|
||||||
|
cOpts := (*C.rbd_encryption_luks_format_options_t)(C.malloc(cOptsSize))
|
||||||
|
cOpts.passphrase = cPassphrase
|
||||||
|
cOpts.passphrase_size = C.size_t(len(opts.Passphrase))
|
||||||
|
|
||||||
|
spec.format = C.RBD_ENCRYPTION_FORMAT_LUKS
|
||||||
|
spec.opts = C.rbd_encryption_options_t(cOpts)
|
||||||
|
spec.opts_size = cOptsSize
|
||||||
|
return func() {
|
||||||
|
C.free(unsafe.Pointer(cOpts.passphrase))
|
||||||
|
C.free(unsafe.Pointer(cOpts))
|
||||||
|
}
|
||||||
|
}
|
2
vendor/github.com/ceph/go-ceph/rbd/group_snap.go
generated
vendored
2
vendor/github.com/ceph/go-ceph/rbd/group_snap.go
generated
vendored
@ -217,7 +217,7 @@ func GroupSnapRollbackWithProgress(
|
|||||||
data: data,
|
data: data,
|
||||||
}
|
}
|
||||||
cbIndex := groupSnapRollbackCallbacks.Add(ctx)
|
cbIndex := groupSnapRollbackCallbacks.Add(ctx)
|
||||||
defer diffIterateCallbacks.Remove(cbIndex)
|
defer groupSnapRollbackCallbacks.Remove(cbIndex)
|
||||||
|
|
||||||
ret := C.wrap_rbd_group_snap_rollback_with_progress(
|
ret := C.wrap_rbd_group_snap_rollback_with_progress(
|
||||||
cephIoctx(ioctx),
|
cephIoctx(ioctx),
|
||||||
|
2
vendor/github.com/ceph/go-ceph/rbd/group_snap_info.go
generated
vendored
2
vendor/github.com/ceph/go-ceph/rbd/group_snap_info.go
generated
vendored
@ -1,5 +1,3 @@
|
|||||||
//go:build ceph_preview
|
|
||||||
|
|
||||||
package rbd
|
package rbd
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
42
vendor/github.com/ceph/go-ceph/rbd/mirror.go
generated
vendored
42
vendor/github.com/ceph/go-ceph/rbd/mirror.go
generated
vendored
@ -666,23 +666,23 @@ var iterBufSize = 64
|
|||||||
// const char *start_id, size_t max, char **image_ids,
|
// const char *start_id, size_t max, char **image_ids,
|
||||||
// rbd_mirror_image_status_t *images, size_t *len)
|
// rbd_mirror_image_status_t *images, size_t *len)
|
||||||
func MirrorImageGlobalStatusList(
|
func MirrorImageGlobalStatusList(
|
||||||
ioctx *rados.IOContext, start string, max int) ([]GlobalMirrorImageIDAndStatus, error) {
|
ioctx *rados.IOContext, start string, maxItems int) ([]GlobalMirrorImageIDAndStatus, error) {
|
||||||
var (
|
var (
|
||||||
result []GlobalMirrorImageIDAndStatus
|
result []GlobalMirrorImageIDAndStatus
|
||||||
fetchAll bool
|
fetchAll bool
|
||||||
)
|
)
|
||||||
if max <= 0 {
|
if maxItems <= 0 {
|
||||||
max = iterBufSize
|
maxItems = iterBufSize
|
||||||
fetchAll = true
|
fetchAll = true
|
||||||
}
|
}
|
||||||
chunk := make([]GlobalMirrorImageIDAndStatus, max)
|
chunk := make([]GlobalMirrorImageIDAndStatus, maxItems)
|
||||||
for {
|
for {
|
||||||
length, err := mirrorImageGlobalStatusList(ioctx, start, chunk)
|
length, err := mirrorImageGlobalStatusList(ioctx, start, chunk)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
result = append(result, chunk[:length]...)
|
result = append(result, chunk[:length]...)
|
||||||
if !fetchAll || length < max {
|
if !fetchAll || length < maxItems {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
start = chunk[length-1].ID
|
start = chunk[length-1].ID
|
||||||
@ -700,7 +700,7 @@ func mirrorImageGlobalStatusList(
|
|||||||
defer C.free(unsafe.Pointer(cStart))
|
defer C.free(unsafe.Pointer(cStart))
|
||||||
|
|
||||||
var (
|
var (
|
||||||
max = C.size_t(len(results))
|
maxItems = C.size_t(len(results))
|
||||||
length = C.size_t(0)
|
length = C.size_t(0)
|
||||||
ids = make([]*C.char, len(results))
|
ids = make([]*C.char, len(results))
|
||||||
images = make([]C.rbd_mirror_image_global_status_t, len(results))
|
images = make([]C.rbd_mirror_image_global_status_t, len(results))
|
||||||
@ -708,7 +708,7 @@ func mirrorImageGlobalStatusList(
|
|||||||
ret := C.rbd_mirror_image_global_status_list(
|
ret := C.rbd_mirror_image_global_status_list(
|
||||||
cephIoctx(ioctx),
|
cephIoctx(ioctx),
|
||||||
cStart,
|
cStart,
|
||||||
max,
|
maxItems,
|
||||||
&ids[0],
|
&ids[0],
|
||||||
&images[0],
|
&images[0],
|
||||||
&length)
|
&length)
|
||||||
@ -807,23 +807,23 @@ type MirrorImageInfoItem struct {
|
|||||||
// rbd_mirror_image_info_t *info_entries, size_t *num_entries)
|
// rbd_mirror_image_info_t *info_entries, size_t *num_entries)
|
||||||
func MirrorImageInfoList(
|
func MirrorImageInfoList(
|
||||||
ioctx *rados.IOContext, modeFilter ImageMirrorModeFilter, start string,
|
ioctx *rados.IOContext, modeFilter ImageMirrorModeFilter, start string,
|
||||||
max int) ([]MirrorImageInfoItem, error) {
|
maxItems int) ([]MirrorImageInfoItem, error) {
|
||||||
var (
|
var (
|
||||||
result []MirrorImageInfoItem
|
result []MirrorImageInfoItem
|
||||||
fetchAll bool
|
fetchAll bool
|
||||||
)
|
)
|
||||||
if max <= 0 {
|
if maxItems <= 0 {
|
||||||
max = iterBufSize
|
maxItems = iterBufSize
|
||||||
fetchAll = true
|
fetchAll = true
|
||||||
}
|
}
|
||||||
chunk := make([]MirrorImageInfoItem, max)
|
chunk := make([]MirrorImageInfoItem, maxItems)
|
||||||
for {
|
for {
|
||||||
length, err := mirrorImageInfoList(ioctx, start, modeFilter, chunk)
|
length, err := mirrorImageInfoList(ioctx, start, modeFilter, chunk)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
result = append(result, chunk[:length]...)
|
result = append(result, chunk[:length]...)
|
||||||
if !fetchAll || length < max {
|
if !fetchAll || length < maxItems {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
start = chunk[length-1].ID
|
start = chunk[length-1].ID
|
||||||
@ -838,7 +838,7 @@ func mirrorImageInfoList(ioctx *rados.IOContext, start string,
|
|||||||
defer C.free(unsafe.Pointer(cStart))
|
defer C.free(unsafe.Pointer(cStart))
|
||||||
|
|
||||||
var (
|
var (
|
||||||
max = C.size_t(len(results))
|
maxItems = C.size_t(len(results))
|
||||||
length = C.size_t(0)
|
length = C.size_t(0)
|
||||||
ids = make([]*C.char, len(results))
|
ids = make([]*C.char, len(results))
|
||||||
modes = make([]C.rbd_mirror_image_mode_t, len(results))
|
modes = make([]C.rbd_mirror_image_mode_t, len(results))
|
||||||
@ -853,7 +853,7 @@ func mirrorImageInfoList(ioctx *rados.IOContext, start string,
|
|||||||
cephIoctx(ioctx),
|
cephIoctx(ioctx),
|
||||||
modeFilterPtr,
|
modeFilterPtr,
|
||||||
cStart,
|
cStart,
|
||||||
max,
|
maxItems,
|
||||||
&ids[0],
|
&ids[0],
|
||||||
&modes[0],
|
&modes[0],
|
||||||
&infos[0],
|
&infos[0],
|
||||||
@ -949,23 +949,23 @@ type MirrorImageInstanceIDItem struct {
|
|||||||
// size_t *len)
|
// size_t *len)
|
||||||
func MirrorImageInstanceIDList(
|
func MirrorImageInstanceIDList(
|
||||||
ioctx *rados.IOContext, start string,
|
ioctx *rados.IOContext, start string,
|
||||||
max int) ([]MirrorImageInstanceIDItem, error) {
|
maxItems int) ([]MirrorImageInstanceIDItem, error) {
|
||||||
var (
|
var (
|
||||||
result []MirrorImageInstanceIDItem
|
result []MirrorImageInstanceIDItem
|
||||||
fetchAll bool
|
fetchAll bool
|
||||||
)
|
)
|
||||||
if max <= 0 {
|
if maxItems <= 0 {
|
||||||
max = iterBufSize
|
maxItems = iterBufSize
|
||||||
fetchAll = true
|
fetchAll = true
|
||||||
}
|
}
|
||||||
chunk := make([]MirrorImageInstanceIDItem, max)
|
chunk := make([]MirrorImageInstanceIDItem, maxItems)
|
||||||
for {
|
for {
|
||||||
length, err := mirrorImageInstanceIDList(ioctx, start, chunk)
|
length, err := mirrorImageInstanceIDList(ioctx, start, chunk)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
result = append(result, chunk[:length]...)
|
result = append(result, chunk[:length]...)
|
||||||
if !fetchAll || length < max {
|
if !fetchAll || length < maxItems {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
start = chunk[length-1].ID
|
start = chunk[length-1].ID
|
||||||
@ -980,7 +980,7 @@ func mirrorImageInstanceIDList(ioctx *rados.IOContext, start string,
|
|||||||
defer C.free(unsafe.Pointer(cStart))
|
defer C.free(unsafe.Pointer(cStart))
|
||||||
|
|
||||||
var (
|
var (
|
||||||
max = C.size_t(len(results))
|
maxItems = C.size_t(len(results))
|
||||||
length = C.size_t(0)
|
length = C.size_t(0)
|
||||||
ids = make([]*C.char, len(results))
|
ids = make([]*C.char, len(results))
|
||||||
instanceIDs = make([]*C.char, len(results))
|
instanceIDs = make([]*C.char, len(results))
|
||||||
@ -988,7 +988,7 @@ func mirrorImageInstanceIDList(ioctx *rados.IOContext, start string,
|
|||||||
ret := C.rbd_mirror_image_instance_id_list(
|
ret := C.rbd_mirror_image_instance_id_list(
|
||||||
cephIoctx(ioctx),
|
cephIoctx(ioctx),
|
||||||
cStart,
|
cStart,
|
||||||
max,
|
maxItems,
|
||||||
&ids[0],
|
&ids[0],
|
||||||
&instanceIDs[0],
|
&instanceIDs[0],
|
||||||
&length,
|
&length,
|
||||||
|
2
vendor/github.com/ceph/go-ceph/rbd/sparsify.go
generated
vendored
2
vendor/github.com/ceph/go-ceph/rbd/sparsify.go
generated
vendored
@ -72,7 +72,7 @@ func (image *Image) SparsifyWithProgress(
|
|||||||
data: data,
|
data: data,
|
||||||
}
|
}
|
||||||
cbIndex := sparsifyCallbacks.Add(ctx)
|
cbIndex := sparsifyCallbacks.Add(ctx)
|
||||||
defer diffIterateCallbacks.Remove(cbIndex)
|
defer sparsifyCallbacks.Remove(cbIndex)
|
||||||
|
|
||||||
ret := C.wrap_rbd_sparsify_with_progress(image.image, C.size_t(sparseSize), C.uintptr_t(cbIndex))
|
ret := C.wrap_rbd_sparsify_with_progress(image.image, C.size_t(sparseSize), C.uintptr_t(cbIndex))
|
||||||
|
|
||||||
|
4
vendor/modules.txt
vendored
4
vendor/modules.txt
vendored
@ -217,8 +217,8 @@ github.com/ceph/ceph-csi/api/deploy/kubernetes/cephfs
|
|||||||
github.com/ceph/ceph-csi/api/deploy/kubernetes/nfs
|
github.com/ceph/ceph-csi/api/deploy/kubernetes/nfs
|
||||||
github.com/ceph/ceph-csi/api/deploy/kubernetes/rbd
|
github.com/ceph/ceph-csi/api/deploy/kubernetes/rbd
|
||||||
github.com/ceph/ceph-csi/api/deploy/ocp
|
github.com/ceph/ceph-csi/api/deploy/ocp
|
||||||
# github.com/ceph/go-ceph v0.31.0
|
# github.com/ceph/go-ceph v0.32.0
|
||||||
## explicit; go 1.19
|
## explicit; go 1.21
|
||||||
github.com/ceph/go-ceph/cephfs
|
github.com/ceph/go-ceph/cephfs
|
||||||
github.com/ceph/go-ceph/cephfs/admin
|
github.com/ceph/go-ceph/cephfs/admin
|
||||||
github.com/ceph/go-ceph/common/admin/manager
|
github.com/ceph/go-ceph/common/admin/manager
|
||||||
|
Loading…
Reference in New Issue
Block a user