From: Max Kellermann Date: Mon, 28 Oct 2024 16:41:11 +0000 (+0100) Subject: mds/inode_backtrace: un-inline methods to reduce header dependencies X-Git-Tag: v20.3.0~40^2~30 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a9dab351d7b19bffe1590e3303fdf0ec5ae6d932;p=ceph.git mds/inode_backtrace: un-inline methods to reduce header dependencies Signed-off-by: Max Kellermann --- diff --git a/src/mds/inode_backtrace.cc b/src/mds/inode_backtrace.cc index be58d1bc3c0..ba4c5feffcf 100644 --- a/src/mds/inode_backtrace.cc +++ b/src/mds/inode_backtrace.cc @@ -161,3 +161,11 @@ int inode_backtrace_t::compare(const inode_backtrace_t& other, *equivalent = false; return comparator; } + +std::ostream& operator<<(std::ostream& out, const inode_backpointer_t& ib) { + return out << "<" << ib.dirino << "/" << ib.dname << " v" << ib.version << ">"; +} + +std::ostream& operator<<(std::ostream& out, const inode_backtrace_t& it) { + return out << "(" << it.pool << ")" << it.ino << ":" << it.ancestors << "//" << it.old_pools; +} diff --git a/src/mds/inode_backtrace.h b/src/mds/inode_backtrace.h index 65029ed1aef..fbad458e7c5 100644 --- a/src/mds/inode_backtrace.h +++ b/src/mds/inode_backtrace.h @@ -4,7 +4,7 @@ #define CEPH_INODE_BACKTRACE_H #include -#include +#include #include #include #include @@ -47,9 +47,7 @@ inline bool operator==(const inode_backpointer_t& l, const inode_backpointer_t& return l.dirino == r.dirino && l.version == r.version && l.dname == r.dname; } -inline std::ostream& operator<<(std::ostream& out, const inode_backpointer_t& ib) { - return out << "<" << ib.dirino << "/" << ib.dname << " v" << ib.version << ">"; -} +std::ostream& operator<<(std::ostream& out, const inode_backpointer_t& ib); /* * inode_backtrace_t is a complete ancestor backtraces for a given inode. @@ -91,9 +89,7 @@ struct inode_backtrace_t { }; WRITE_CLASS_ENCODER(inode_backtrace_t) -inline std::ostream& operator<<(std::ostream& out, const inode_backtrace_t& it) { - return out << "(" << it.pool << ")" << it.ino << ":" << it.ancestors << "//" << it.old_pools; -} +std::ostream& operator<<(std::ostream& out, const inode_backtrace_t& it); inline bool operator==(const inode_backtrace_t& l, const inode_backtrace_t& r) {