]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/inode_backtrace: un-inline methods to reduce header dependencies
authorMax Kellermann <max.kellermann@ionos.com>
Mon, 28 Oct 2024 16:41:11 +0000 (17:41 +0100)
committerMax Kellermann <max.kellermann@ionos.com>
Thu, 17 Apr 2025 13:59:27 +0000 (15:59 +0200)
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/mds/inode_backtrace.cc
src/mds/inode_backtrace.h

index be58d1bc3c0e0362294e6f27fbda1fbd472bdb36..ba4c5feffcfebb419f584bb725ff58ee4b6d77a4 100644 (file)
@@ -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;
+}
index 65029ed1aef61ba32ed66493cdd1edcf7e29db41..fbad458e7c55abaf5a5ce802cdfda04d3b3fcf7a 100644 (file)
@@ -4,7 +4,7 @@
 #define CEPH_INODE_BACKTRACE_H
 
 #include <list>
-#include <ostream>
+#include <iosfwd>
 #include <string>
 #include <string_view>
 #include <vector>
@@ -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) {