Skip to content

Commit 4d7941f

Browse files
MaxKellermannvshankar
authored andcommitted
include/fs_types: un-inline operator<<(inodeno_t)
Allows switching to `iosfwd`. Signed-off-by: Max Kellermann <[email protected]>
1 parent 7ed0de7 commit 4d7941f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/common/fs_types.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@
77
#include "common/ceph_json.h"
88
#include "include/denc.h"
99

10+
#include <iostream>
11+
1012
void inodeno_t::dump(ceph::Formatter *f) const {
1113
f->dump_unsigned("val", val);
1214
}
1315

16+
std::ostream& operator<<(std::ostream& out, const inodeno_t& ino) {
17+
return out << std::hex << "0x" << ino.val << std::dec;
18+
}
19+
1420
void dump(const ceph_file_layout& l, ceph::Formatter *f)
1521
{
1622
f->dump_unsigned("stripe_unit", l.fl_stripe_unit);

src/include/fs_types.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <cstdint>
77
#include <list>
8-
#include <iostream>
8+
#include <iosfwd>
99
#include <string>
1010

1111
#include "include/buffer.h"
@@ -70,9 +70,7 @@ struct denc_traits<inodeno_t> {
7070
}
7171
};
7272

73-
inline std::ostream& operator<<(std::ostream& out, const inodeno_t& ino) {
74-
return out << std::hex << "0x" << ino.val << std::dec;
75-
}
73+
std::ostream& operator<<(std::ostream& out, const inodeno_t& ino);
7674

7775
namespace std {
7876
template<>

0 commit comments

Comments
 (0)