From: Max Kellermann Date: Fri, 4 Oct 2024 20:12:33 +0000 (+0200) Subject: mds/CDentry: include cleanup X-Git-Tag: v20.3.0~40^2~13 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9ad1ba76233297011d10f485033abe03986a788e;p=ceph.git mds/CDentry: include cleanup Signed-off-by: Max Kellermann --- diff --git a/src/mds/CDentry.cc b/src/mds/CDentry.cc index db861c8a8b150..280da26eebb48 100644 --- a/src/mds/CDentry.cc +++ b/src/mds/CDentry.cc @@ -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 @@ -36,6 +38,39 @@ 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 << ") "; diff --git a/src/mds/CDentry.h b/src/mds/CDentry.h index a353eda3edd50..07766fbaf78ab 100644 --- a/src/mds/CDentry.h +++ b/src/mds/CDentry.h @@ -23,21 +23,21 @@ #include "include/buffer_fwd.h" #include "include/lru.h" #include "include/elist.h" -#include "include/filepath.h" #include -#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) {