]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: switch get_orig_source_inst() to get_message() in OpsExecuter.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 29 Aug 2019 14:32:16 +0000 (16:32 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 13 Sep 2019 20:12:31 +0000 (22:12 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/objclass.cc
src/crimson/osd/ops_executer.h

index 2090fbe7c3d9ca06a15acf4b3cf2838f6213efd5..517505c60f299e436e56d376afe73d5182eed479 100644 (file)
@@ -53,10 +53,16 @@ int cls_read(cls_method_context_t hctx,
 
 int cls_get_request_origin(cls_method_context_t hctx, entity_inst_t *origin)
 {
-  assert(origin)
-  *origin =
-    reinterpret_cast<ceph::osd::OpsExecuter*>(hctx)->get_orig_source_inst();
-  return 0;
+  assert(origin);
+
+  try {
+    const auto& message = \
+      reinterpret_cast<ceph::osd::OpsExecuter*>(hctx)->get_message();
+    *origin = message.get_orig_source_inst();
+    return 0;
+  } catch (ceph::osd::error& e) {
+    return -e.code().value();
+  }
 }
 
 int cls_cxx_create(cls_method_context_t hctx, const bool exclusive)
index 87acd240122c055f8ed3122d84409f09fea92e5b..295cefebc9cc8c31524adf069e159721d0441937 100644 (file)
@@ -109,8 +109,8 @@ public:
   template <typename Func>
   seastar::future<> submit_changes(Func&& f) &&;
 
-  auto get_orig_source_inst() const {
-    return msg->get_orig_source_inst();
+  const auto& get_message() const {
+    return *msg;
   }
 };