]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/CInode: un-inline methods to reduce header dependencies
authorMax Kellermann <max.kellermann@ionos.com>
Fri, 25 Oct 2024 13:51:57 +0000 (15:51 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Thu, 17 Apr 2025 16:00:16 +0000 (18:00 +0200)
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/mds/CInode.cc
src/mds/CInode.h

index e173e86a16a7d1fdfd49051e98767fed9e8ea54b..01fd41fa6587277e90330afcfc4b98ea6e22bb05 100644 (file)
@@ -39,6 +39,7 @@
 #include "common/Clock.h"
 #include "common/ceph_json.h"
 #include "common/config.h"
+#include "common/debug.h"
 #include "common/errno.h"
 #include "global/global_context.h"
 #include "include/denc.h"
@@ -946,6 +947,29 @@ void CInode::put_stickydirs()
 
 // pins
 
+void CInode::bad_put(int by) {
+  generic_dout(0) << " bad put " << *this << " by " << by << " " << pin_name(by) << " was " << ref
+#ifdef MDS_REF_SET
+                 << " (" << ref_map << ")"
+#endif
+                 << dendl;
+#ifdef MDS_REF_SET
+  ceph_assert(ref_map[by] > 0);
+#endif
+  ceph_assert(ref > 0);
+}
+
+void CInode::bad_get(int by) {
+  generic_dout(0) << " bad get " << *this << " by " << by << " " << pin_name(by) << " was " << ref
+#ifdef MDS_REF_SET
+                 << " (" << ref_map << ")"
+#endif
+                 << dendl;
+#ifdef MDS_REF_SET
+  ceph_assert(ref_map[by] >= 0);
+#endif
+}
+
 void CInode::first_get()
 {
   // pin my dentry?
index af7abf5beb40af219f95bc7d1721e98e03711667..17c318f22692f66ed76d7594f9da59852c4b4874 100644 (file)
@@ -23,7 +23,6 @@
 #include <vector>
 
 #include "common/config.h"
-#include "common/debug.h"
 #include "common/ref.h" // for cref_t
 #include "include/compat.h"
 #include "include/Context.h" // for C_GatherBuilder
@@ -46,8 +45,6 @@
 
 #include <boost/intrusive_ptr.hpp>
 
-#define dout_context g_ceph_context
-
 struct sr_t;
 class BatchOp;
 class Context;
@@ -967,27 +964,8 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counter<CIno
   void unfreeze_auth_pin();
 
   // -- reference counting --
-  void bad_put(int by) override {
-    generic_dout(0) << " bad put " << *this << " by " << by << " " << pin_name(by) << " was " << ref
-#ifdef MDS_REF_SET
-                   << " (" << ref_map << ")"
-#endif
-                   << dendl;
-#ifdef MDS_REF_SET
-    ceph_assert(ref_map[by] > 0);
-#endif
-    ceph_assert(ref > 0);
-  }
-  void bad_get(int by) override {
-    generic_dout(0) << " bad get " << *this << " by " << by << " " << pin_name(by) << " was " << ref
-#ifdef MDS_REF_SET
-                   << " (" << ref_map << ")"
-#endif
-                   << dendl;
-#ifdef MDS_REF_SET
-    ceph_assert(ref_map[by] >= 0);
-#endif
-  }
+  void bad_put(int by) override;
+  void bad_get(int by) override;
   void first_get() override;
   void last_put() override;
   void _put() override;
@@ -1284,5 +1262,5 @@ std::ostream& operator<<(std::ostream& out, const CInode& in);
 
 extern cinode_lock_info_t cinode_lock_info[];
 extern int num_cinode_locks;
-#undef dout_context
+
 #endif