]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/CDir: include cleanup
authorMax Kellermann <max.kellermann@ionos.com>
Fri, 4 Oct 2024 20:06:12 +0000 (22:06 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Thu, 17 Apr 2025 15:25:00 +0000 (17:25 +0200)
By un-inlining the constructor and destructor, the header dependency
on "common/bloom_filter.hpp" can be eliminated.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/mds/CDir.cc
src/mds/CDir.h

index 1bac7526bed56a3417d704399d895ac5bc78bab4..b5a694a5c480a60f477164c80396cfff75c4e74b 100644 (file)
 #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;
 
index bfdb363d98a5f5be7742c53ffe8ae49f2a5f3176..fa61b1dc37c0d9e3298db1007badf32353e6ed72 100644 (file)
 #include <string>
 #include <string_view>
 
-#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<snapid_t>& snaps);