]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd, rgw: implement the new Objclass API methods for cls_rgw 46205/head
authorRadosław Zarzyński <rzarzyns@redhat.com>
Mon, 9 May 2022 12:43:34 +0000 (14:43 +0200)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Mon, 9 May 2022 15:13:58 +0000 (17:13 +0200)
They were introduced by 3877c1e37f2fa4e1574b57f05132288f210835a7.

Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
src/crimson/osd/objclass.cc
src/crimson/osd/ops_executer.h

index d4fcbeebdf0388ca73dbc725918c26e872a0e5de..ae3e61b3bc9d0e06aa8129714ec617dcb5fc9c16 100644 (file)
@@ -7,6 +7,7 @@
 #include "common/ceph_context.h"
 #include "common/ceph_releases.h"
 #include "common/config.h"
+#include "crimson/common/config_proxy.h"
 #include "common/debug.h"
 
 #include "crimson/osd/exceptions.h"
@@ -498,16 +499,12 @@ ceph_release_t cls_get_min_compatible_client(cls_method_context_t hctx)
 
 const ConfigProxy& cls_get_config(cls_method_context_t hctx)
 {
-  // FIXME ; segfault if ever called
-  static ConfigProxy* dummy = nullptr;
-  return *dummy;
+  return crimson::common::local_conf();
 }
 
 const object_info_t& cls_get_object_info(cls_method_context_t hctx)
 {
-  // FIXME ; segfault if ever called
-  static object_info_t* dummy = nullptr;
-  return *dummy;
+  return reinterpret_cast<crimson::osd::OpsExecuter*>(hctx)->get_object_info();
 }
 
 int cls_get_snapset_seq(cls_method_context_t hctx, uint64_t *snap_seq)
index 0387ef8dc0b587b8881484eb753d49995c69015c..9a2cd189430c50e55c26f8b4211a7083fcca98fb 100644 (file)
@@ -273,8 +273,11 @@ public:
     const std::vector<OSDOp>& ops);
   void fill_op_params_bump_pg_version();
 
+  const object_info_t &get_object_info() const {
+    return obc->obs.oi;
+  }
   const hobject_t &get_target() const {
-    return obc->obs.oi.soid;
+    return get_object_info().soid;
   }
 
   const auto& get_message() const {