From: Max Kellermann Date: Fri, 4 Oct 2024 19:58:38 +0000 (+0200) Subject: mds/CInode: include cleanup X-Git-Tag: testing/wip-pdonnell-testing-20250421.184056-debug~2^2~14 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d3f5db57f8ab5c1150c3a348ae9bad788f3c7d37;p=ceph-ci.git mds/CInode: include cleanup Un-inline the destructor to eliminate a few more dependencies from the public header. Signed-off-by: Max Kellermann --- diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 0487759ecb0..e173e86a16a 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -12,12 +12,10 @@ * */ -#include "include/int_types.h" -#include "common/errno.h" +#include "CInode.h" #include -#include "CInode.h" #include "CDir.h" #include "CDentry.h" #include "BatchOp.h" @@ -50,7 +48,6 @@ #include "mds/MDSContinuation.h" #include "mds/InoTable.h" -#include "cephfs_features.h" #include "osdc/Objecter.h" #include "messages/MClientCaps.h" @@ -119,6 +116,17 @@ const LockType CInode::nestlock_type(CEPH_LOCK_INEST); const LockType CInode::flocklock_type(CEPH_LOCK_IFLOCK); const LockType CInode::policylock_type(CEPH_LOCK_IPOLICY); +CInode::~CInode() { + close_dirfrags(); + close_snaprealm(); + clear_file_locks(); + ceph_assert(num_projected_srnodes == 0); + ceph_assert(num_caps_notable == 0); + ceph_assert(num_subtree_roots == 0); + ceph_assert(num_exporting_dirs == 0); + ceph_assert(batch_ops.empty()); +} + std::string_view CInode::pin_name(int p) const { switch (p) { diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 627ec5e6414..af7abf5beb4 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -25,14 +25,12 @@ #include "common/config.h" #include "common/debug.h" #include "common/ref.h" // for cref_t -#include "common/RefCountedObj.h" #include "include/compat.h" #include "include/Context.h" // for C_GatherBuilder #include "include/counter.h" #include "include/elist.h" #include "include/filepath.h" #include "include/types.h" -#include "include/lru.h" #include "include/compact_set.h" #include "MDSCacheObject.h" @@ -40,17 +38,11 @@ #include "flock.h" #include "inode_backtrace.h" // for inode_backtrace_t -#include "BatchOp.h" -#include "CDentry.h" #include "ScrubHeader.h" #include "SimpleLock.h" #include "ScatterLock.h" #include "LocalLockC.h" #include "Capability.h" -#include "SnapRealm.h" -#include "Mutation.h" - -#include "messages/MClientCaps.h" #include @@ -428,16 +420,7 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counter> batch_ops;