From 6f22117792d33411d97d584f66f22a82db203820 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 4 Oct 2024 22:06:12 +0200 Subject: [PATCH] mds/CDir: include cleanup By un-inlining the constructor and destructor, the header dependency on "common/bloom_filter.hpp" can be eliminated. Signed-off-by: Max Kellermann --- src/mds/CDir.cc | 11 +++++++++++ src/mds/CDir.h | 15 +++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 1bac7526bed56..b5a694a5c480a 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -30,8 +30,11 @@ #include "LogSegment.h" #include "MDBalancer.h" #include "SnapClient.h" +#include "SnapRealm.h" +#include "events/EMetaBlob.h" #include "common/bloom_filter.hpp" +#include "common/debug.h" #include "common/likely.h" #include "include/Context.h" #include "common/Clock.h" @@ -42,6 +45,8 @@ #include "include/ceph_assert.h" #include "include/compat.h" +#include "messages/MClientReply.h" // for struct DirStat + #define dout_context g_ceph_context #define dout_subsys ceph_subsys_mds #undef dout_prefix @@ -219,6 +224,8 @@ CDir::CDir(CInode *in, frag_t fg, MDCache *mdc, bool auth) : state_set(STATE_AUTH); } +CDir::~CDir() noexcept = default; + /** * Check the recursive statistics on size for consistency. * If mds_debug_scatterstat is enabled, assert for correctness, @@ -861,6 +868,10 @@ bool CDir::is_in_bloom(std::string_view name) return bloom->contains(name.data(), name.size()); } +void CDir::remove_bloom() { + bloom.reset(); +} + void CDir::remove_null_dentries() { dout(12) << __func__ << " " << *this << dendl; diff --git a/src/mds/CDir.h b/src/mds/CDir.h index bfdb363d98a5f..fa61b1dc37c0d 100644 --- a/src/mds/CDir.h +++ b/src/mds/CDir.h @@ -23,19 +23,19 @@ #include #include -#include "common/bloom_filter.hpp" #include "common/config.h" #include "include/buffer_fwd.h" #include "include/counter.h" #include "include/types.h" +#include "snap.h" // for struct sr_t #include "CInode.h" #include "MDSCacheObject.h" -#include "MDSContext.h" -#include "cephfs_features.h" -#include "SessionMap.h" -#include "messages/MClientReply.h" +#include "Mutation.h" // for struct MDLockCache +struct DirStat; +struct session_info_t; +class bloom_filter; class CDentry; class MDCache; @@ -204,6 +204,7 @@ public: static const int DUMP_DEFAULT = DUMP_ALL & (~DUMP_ITEMS); CDir(CInode *in, frag_t fg, MDCache *mdc, bool auth); + ~CDir() noexcept; std::string_view pin_name(int p) const override { switch (p) { @@ -396,9 +397,7 @@ public: void add_to_bloom(CDentry *dn); bool is_in_bloom(std::string_view name); bool has_bloom() { return (bloom ? true : false); } - void remove_bloom() { - bloom.reset(); - } + void remove_bloom(); void try_remove_dentries_for_stray(); bool try_trim_snap_dentry(CDentry *dn, const std::set& snaps); -- 2.39.5