]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/CrushWrapper: un-inline methods to fix linker errors 61872/head
authorMax Kellermann <max.kellermann@ionos.com>
Thu, 9 Jan 2025 13:49:22 +0000 (14:49 +0100)
committerMax Kellermann <max.kellermann@ionos.com>
Tue, 18 Feb 2025 12:18:00 +0000 (13:18 +0100)
The `crush_objs` library is not part of the `libceph-common` ABI, so
applications linking with `libceph-common` may fail to build because
the linker cannot find `crush_destroy()`.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h

index 44fd84e400e0562e013799920feed2c273c3b080..cf4ad46e695f958fb8f3c14233bdb32e57b46b78 100644 (file)
@@ -30,6 +30,25 @@ using ceph::decode_nohead;
 using ceph::encode;
 using ceph::Formatter;
 
+CrushWrapper::~CrushWrapper()
+{
+  if (crush)
+    crush_destroy(crush);
+  choose_args_clear();
+}
+
+void CrushWrapper::create()
+{
+  if (crush)
+    crush_destroy(crush);
+  crush = crush_create();
+  choose_args_clear();
+  ceph_assert(crush);
+  have_rmaps = false;
+
+  set_tunables_default();
+}
+
 bool CrushWrapper::has_non_straw2_buckets() const
 {
   for (int i=0; i<crush->max_buckets; ++i) {
index ef7d2b9976576f4555b2dc9d96b1af71087b41ee..7d76713284ad665426ad4501a1adba1d5000add2 100644 (file)
@@ -93,25 +93,12 @@ public:
   CrushWrapper() {
     create();
   }
-  ~CrushWrapper() {
-    if (crush)
-      crush_destroy(crush);
-    choose_args_clear();
-  }
+  ~CrushWrapper();
 
   crush_map *get_crush_map() { return crush; }
 
   /* building */
-  void create() {
-    if (crush)
-      crush_destroy(crush);
-    crush = crush_create();
-    choose_args_clear();
-    ceph_assert(crush);
-    have_rmaps = false;
-
-    set_tunables_default();
-  }
+  void create();
 
   /// true if any buckets that aren't straw2
   bool has_non_straw2_buckets() const;