From 2d8dfffe4d5e32b09b816f4cbc8e0c976318b0b8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 25 Oct 2024 15:51:57 +0200 Subject: [PATCH] mds/CInode: un-inline methods to reduce header dependencies Signed-off-by: Max Kellermann --- src/mds/CInode.cc | 24 ++++++++++++++++++++++++ src/mds/CInode.h | 28 +++------------------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index e173e86a16a..01fd41fa658 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -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? diff --git a/src/mds/CInode.h b/src/mds/CInode.h index af7abf5beb4..17c318f2269 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -23,7 +23,6 @@ #include #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 -#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 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 -- 2.47.3