From: Max Kellermann Date: Fri, 25 Oct 2024 13:51:57 +0000 (+0200) Subject: mds/CInode: un-inline methods to reduce header dependencies X-Git-Tag: v20.3.0~40^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2d8dfffe4d5e32b09b816f4cbc8e0c976318b0b8;p=ceph.git mds/CInode: un-inline methods to reduce header dependencies Signed-off-by: Max Kellermann --- diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index e173e86a16a7..01fd41fa6587 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 af7abf5beb40..17c318f22692 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