]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/CDentry: include cleanup
authorMax Kellermann <max.kellermann@ionos.com>
Fri, 4 Oct 2024 20:12:33 +0000 (22:12 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Thu, 17 Apr 2025 16:00:16 +0000 (18:00 +0200)
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/mds/CDentry.cc
src/mds/CDentry.h

index db861c8a8b150d7f9baec9cbf4a11b65e086e1dd..280da26eebb48a743f34ea66ea9347e9cf6477e8 100644 (file)
@@ -19,6 +19,7 @@
 #include "CDir.h"
 #include "SnapClient.h"
 #include "SnapRealm.h"
+#include "BatchOp.h"
 #include "MDSRank.h"
 #include "MDCache.h"
 #include "Locker.h"
@@ -28,6 +29,7 @@
 
 #include "common/debug.h"
 #include "common/strescape.h" // for binstrprint()
+#include "include/filepath.h"
 
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_mds
 
 using namespace std;
 
+CDentry::CDentry(std::string_view n, __u32 h,
+                mempool::mds_co::string alternate_name,
+                snapid_t f, snapid_t l) :
+  hash(h),
+  first(f), last(l),
+  item_dirty(this),
+  lock(this, &lock_type),
+  versionlock(this, &versionlock_type),
+  name(n),
+  alternate_name(std::move(alternate_name))
+{}
+
+CDentry::CDentry(std::string_view n, __u32 h,
+                mempool::mds_co::string alternate_name,
+                inodeno_t ino, inodeno_t referent_ino,
+                unsigned char dt, snapid_t f, snapid_t l) :
+  hash(h),
+  first(f), last(l),
+  item_dirty(this),
+  lock(this, &lock_type),
+  versionlock(this, &versionlock_type),
+  name(n),
+  alternate_name(std::move(alternate_name))
+{
+  linkage.remote_ino = ino;
+  linkage.remote_d_type = dt;
+  linkage.referent_ino = referent_ino;
+}
+
+CDentry::~CDentry() {
+  ceph_assert(batch_ops.empty());
+}
+
 ostream& CDentry::print_db_line_prefix(ostream& out) const
 {
   return out << ceph_clock_now() << " mds." << dir->mdcache->mds->get_nodeid() << ".cache.den(" << dir->ino() << " " << name << ") ";
index a353eda3edd502144fd090411a8da36bf4cfff6b..07766fbaf78ab8900609d08677f466d31efd7a0f 100644 (file)
 #include "include/buffer_fwd.h"
 #include "include/lru.h"
 #include "include/elist.h"
-#include "include/filepath.h"
 #include <boost/intrusive/set.hpp>
 
-#include "BatchOp.h"
 #include "MDSCacheObject.h"
-#include "MDSContext.h"
 #include "SimpleLock.h"
 #include "LocalLockC.h"
-#include "ScrubHeader.h"
 
+class filepath;
+class BatchOp;
 class CInode;
 class CDir;
 class Locker;
 class CDentry;
 class LogSegment;
+class MDSContext;
+
 class Session;
 
 struct ClientLease : public boost::intrusive::set_base_hook<>
@@ -132,35 +132,13 @@ public:
 
   CDentry(std::string_view n, __u32 h,
           mempool::mds_co::string alternate_name,
-         snapid_t f, snapid_t l) :
-    hash(h),
-    first(f), last(l),
-    item_dirty(this),
-    lock(this, &lock_type),
-    versionlock(this, &versionlock_type),
-    name(n),
-    alternate_name(std::move(alternate_name))
-  {}
+         snapid_t f, snapid_t l);
   CDentry(std::string_view n, __u32 h,
           mempool::mds_co::string alternate_name,
           inodeno_t ino, inodeno_t referent_ino,
-         unsigned char dt, snapid_t f, snapid_t l) :
-    hash(h),
-    first(f), last(l),
-    item_dirty(this),
-    lock(this, &lock_type),
-    versionlock(this, &versionlock_type),
-    name(n),
-    alternate_name(std::move(alternate_name))
-  {
-    linkage.remote_ino = ino;
-    linkage.remote_d_type = dt;
-    linkage.referent_ino = referent_ino;
-  }
+         unsigned char dt, snapid_t f, snapid_t l);
 
-  ~CDentry() override {
-    ceph_assert(batch_ops.empty());
-  }
+  ~CDentry() override;
 
   std::string_view pin_name(int p) const override {
     switch (p) {