mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: use ListChildrenAttributes() instead of ListChildren()
This commit modifies listSnapAndChildren() to make use of ListChildrenAttributes() instead of ListChildren() which allows us to filter out images in trash. This commit also order the alive images so that temp clone images are followed by images backing volume snapshots so that temp clone images are flattened first. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
9
vendor/github.com/ceph/go-ceph/rbd/encryption_load2.go
generated
vendored
9
vendor/github.com/ceph/go-ceph/rbd/encryption_load2.go
generated
vendored
@ -81,25 +81,22 @@ func (image *Image) EncryptionLoad2(opts []EncryptionOptions) error {
|
||||
}
|
||||
|
||||
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)
|
||||
cspecs := make([]C.rbd_encryption_spec_t, length)
|
||||
freeFuncs := make([]func(), length)
|
||||
|
||||
for idx, option := range opts {
|
||||
f := option.(encryptionOptions2).writeEncryptionSpec(&specs[idx])
|
||||
f := option.(encryptionOptions2).writeEncryptionSpec(&cspecs[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.rbd_encryption_spec_t)(unsafe.Pointer(&cspecs[0])),
|
||||
C.size_t(length))
|
||||
return getError(ret)
|
||||
}
|
||||
|
Reference in New Issue
Block a user