]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: constify specs array in rbd_encryption_load2()
authorIlya Dryomov <idryomov@gmail.com>
Sun, 13 Nov 2022 16:10:05 +0000 (17:10 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 4 Dec 2022 17:19:19 +0000 (18:19 +0100)
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/include/rbd/librbd.h
src/include/rbd/librbd.hpp
src/librbd/api/Image.cc
src/librbd/api/Image.h
src/librbd/librbd.cc
src/pybind/rbd/c_rbd.pxd
src/pybind/rbd/mock_rbd.pxi

index 1d08dd44cf9d64f43ddd75b62202a8d074169a93..b99421d1f2a527518f269c44d3cb75bfcf93a7b3 100644 (file)
@@ -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 */
index 010aa6397ff29a64c9416d1e0524714d703fcf2b..5d307cdedf50f3d06724e4d30e25f8f63dd29091 100644 (file)
@@ -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;
index f077602595de4e7ce5d0c3ecddc2022da67ee858..08437701c03f274198c932aebb7927217a7009ee 100644 (file)
@@ -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;
 
index e843f5b51e216b47f5b88da7dce28165598c360b..29398d6cdffb87dddc4cc950c8b73d83ee23a1ab 100644 (file)
@@ -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
index e52c83057ea1f37e9a4f207fbe9f4d3b18904120..54a2d02051eb61496a641ff05714b060b4e2c963 100644 (file)
@@ -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;
index 2415290b175bb51208808699dfbbd583de65be28..885f7bd46abde8e6d379c256f9c0de910a1a1061 100644 (file)
@@ -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)
index 9d8df1328037abf1ebf0eb536f566f3295710673..11872bd8146de7fd29765a129a2fca080f121ece 100644 (file)
@@ -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