From d3f5db57f8ab5c1150c3a348ae9bad788f3c7d37 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 4 Oct 2024 21:58:38 +0200 Subject: [PATCH] mds/CInode: include cleanup Un-inline the destructor to eliminate a few more dependencies from the public header. Signed-off-by: Max Kellermann --- src/mds/CInode.cc | 16 ++++++++++++---- src/mds/CInode.h | 19 +------------------ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 0487759ecb02c..e173e86a16a7d 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 627ec5e641419..af7abf5beb40a 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; -- 2.39.5