]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/crypto/luks/FormatRequest.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / librbd / crypto / luks / FormatRequest.h
index a782dc818fcfcaefa95df86b09e4210d97d9b5c8..17d0b3af990f7e2ecc77ba32361ef87a32571da8 100644 (file)
@@ -4,6 +4,7 @@
 #ifndef CEPH_LIBRBD_CRYPTO_LUKS_FORMAT_REQUEST_H
 #define CEPH_LIBRBD_CRYPTO_LUKS_FORMAT_REQUEST_H
 
+#include <string_view>
 #include "include/rbd/librbd.hpp"
 #include "librbd/ImageCtx.h"
 #include "librbd/crypto/CryptoInterface.h"
@@ -21,16 +22,16 @@ class FormatRequest {
 public:
     static FormatRequest* create(
             I* image_ctx, encryption_format_t format,
-            encryption_algorithm_t alg, std::string&& passphrase,
-            ceph::ref_t<CryptoInterface>* result_crypto, Context* on_finish,
+            encryption_algorithm_t alg, std::string_view passphrase,
+            std::unique_ptr<CryptoInterface>* result_crypto, Context* on_finish,
             bool insecure_fast_mode) {
-      return new FormatRequest(image_ctx, format, alg, std::move(passphrase),
+      return new FormatRequest(image_ctx, format, alg, passphrase,
                                result_crypto, on_finish, insecure_fast_mode);
     }
 
     FormatRequest(I* image_ctx, encryption_format_t format,
-                  encryption_algorithm_t alg, std::string&& passphrase,
-                  ceph::ref_t<CryptoInterface>* result_crypto,
+                  encryption_algorithm_t alg, std::string_view passphrase,
+                  std::unique_ptr<CryptoInterface>* result_crypto,
                   Context* on_finish, bool insecure_fast_mode);
     void send();
     void finish(int r);
@@ -40,8 +41,8 @@ private:
 
     encryption_format_t m_format;
     encryption_algorithm_t m_alg;
-    std::string m_passphrase;
-    ceph::ref_t<CryptoInterface>* m_result_crypto;
+    std::string_view m_passphrase;
+    std::unique_ptr<CryptoInterface>* m_result_crypto;
     Context* m_on_finish;
     bool m_insecure_fast_mode;
     Header m_header;