mirror of
https://github.com/ceph/ceph
synced 2025-01-06 11:12:18 +00:00
librbd: constify specs array in rbd_encryption_load2()
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
5f816f9b2c
commit
adea1ab805
@ -872,7 +872,7 @@ CEPH_RBD_API int rbd_encryption_load(rbd_image_t image,
|
||||
* interpreted as plaintext.
|
||||
*/
|
||||
CEPH_RBD_API int rbd_encryption_load2(rbd_image_t image,
|
||||
rbd_encryption_spec_t *specs,
|
||||
const rbd_encryption_spec_t *specs,
|
||||
size_t spec_count);
|
||||
|
||||
/* snapshots */
|
||||
|
@ -600,7 +600,7 @@ public:
|
||||
size_t opts_size);
|
||||
int encryption_load(encryption_format_t format, encryption_options_t opts,
|
||||
size_t opts_size);
|
||||
int encryption_load2(encryption_spec_t *specs, size_t spec_count);
|
||||
int encryption_load2(const encryption_spec_t *specs, size_t spec_count);
|
||||
|
||||
/* striping */
|
||||
uint64_t get_stripe_unit() const;
|
||||
|
@ -974,7 +974,7 @@ int Image<I>::encryption_format(I* ictx, encryption_format_t format,
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
int Image<I>::encryption_load(I* ictx, encryption_spec_t *specs,
|
||||
int Image<I>::encryption_load(I* ictx, const encryption_spec_t *specs,
|
||||
size_t spec_count, bool c_api) {
|
||||
std::vector<std::unique_ptr<crypto::EncryptionFormat<I>>> formats;
|
||||
|
||||
|
@ -73,9 +73,8 @@ struct Image {
|
||||
static int encryption_format(ImageCtxT *ictx, encryption_format_t format,
|
||||
encryption_options_t opts, size_t opts_size,
|
||||
bool c_api);
|
||||
static int encryption_load(ImageCtxT *ictx, encryption_spec_t *specs,
|
||||
static int encryption_load(ImageCtxT *ictx, const encryption_spec_t *specs,
|
||||
size_t spec_count, bool c_api);
|
||||
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
|
@ -2101,7 +2101,7 @@ namespace librbd {
|
||||
return librbd::api::Image<>::encryption_load(ictx, &spec, 1, false);
|
||||
}
|
||||
|
||||
int Image::encryption_load2(encryption_spec_t *specs, size_t spec_count)
|
||||
int Image::encryption_load2(const encryption_spec_t *specs, size_t spec_count)
|
||||
{
|
||||
ImageCtx *ictx = (ImageCtx *)ctx;
|
||||
return librbd::api::Image<>::encryption_load(
|
||||
@ -4394,7 +4394,7 @@ extern "C" int rbd_encryption_load(rbd_image_t image,
|
||||
}
|
||||
|
||||
extern "C" int rbd_encryption_load2(rbd_image_t image,
|
||||
rbd_encryption_spec_t *specs,
|
||||
const rbd_encryption_spec_t *specs,
|
||||
size_t spec_count)
|
||||
{
|
||||
librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
|
||||
|
@ -728,5 +728,5 @@ cdef extern from "rbd/librbd.h" nogil:
|
||||
rbd_encryption_format_t format,
|
||||
rbd_encryption_options_t opts, size_t opts_size)
|
||||
int rbd_encryption_load2(rbd_image_t image,
|
||||
rbd_encryption_spec_t *specs,
|
||||
const rbd_encryption_spec_t *specs,
|
||||
size_t spec_count)
|
||||
|
@ -918,6 +918,6 @@ cdef nogil:
|
||||
rbd_encryption_options_t opts, size_t opts_size):
|
||||
pass
|
||||
int rbd_encryption_load2(rbd_image_t image,
|
||||
rbd_encryption_spec_t *specs,
|
||||
const rbd_encryption_spec_t *specs,
|
||||
size_t spec_count):
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user