]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/tools/rbd_mirror/image_replayer/Utils.cc
import 15.2.0 Octopus source
[ceph.git] / ceph / src / tools / rbd_mirror / image_replayer / Utils.cc
index eda0179f29d56f8356452219132ee3838e6cb735..55162a4e4b58df9e8b3682c04c5bc058ea7a23e6 100644 (file)
@@ -2,6 +2,7 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "tools/rbd_mirror/image_replayer/Utils.h"
+#include "include/rados/librados.hpp"
 #include "common/debug.h"
 #include "common/errno.h"
 #include "cls/journal/cls_journal_types.h"
@@ -18,6 +19,16 @@ namespace mirror {
 namespace image_replayer {
 namespace util {
 
+std::string compute_image_spec(librados::IoCtx& io_ctx,
+                               const std::string& image_name) {
+  std::string name = io_ctx.get_namespace();
+  if (!name.empty()) {
+    name += "/";
+  }
+
+  return io_ctx.get_pool_name() + "/" + name + image_name;
+}
+
 bool decode_client_meta(const cls::journal::Client& client,
                         librbd::journal::MirrorPeerClientMeta* client_meta) {
   dout(15) << dendl;