Skip to content

Commit 7ed0de7

Browse files
MaxKellermannvshankar
authored andcommitted
include/fs_types: un-inline inodeno_t::dump()
Allows forward-declaring ceph::Formatter. Signed-off-by: Max Kellermann <[email protected]>
1 parent a56aede commit 7ed0de7

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/common/fs_types.cc

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

10+
void inodeno_t::dump(ceph::Formatter *f) const {
11+
f->dump_unsigned("val", val);
12+
}
13+
1014
void dump(const ceph_file_layout& l, ceph::Formatter *f)
1115
{
1216
f->dump_unsigned("stripe_unit", l.fl_stripe_unit);

src/include/fs_types.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
#include <iostream>
99
#include <string>
1010

11-
#include "common/Formatter.h"
1211
#include "include/buffer.h"
1312
#include "include/ceph_fs.h" // for struct ceph_file_layout
1413
#include "include/encoding.h"
1514
#include "include/hash.h" // for rjhash
1615

16+
namespace ceph {
17+
class Formatter;
18+
}
19+
1720
class JSONObj;
1821

1922
// taken from linux kernel: include/uapi/linux/fcntl.h
@@ -42,9 +45,7 @@ struct inodeno_t {
4245
using ceph::decode;
4346
decode(val, p);
4447
}
45-
void dump(ceph::Formatter *f) const {
46-
f->dump_unsigned("val", val);
47-
}
48+
void dump(ceph::Formatter *f) const;
4849
static void generate_test_instances(std::list<inodeno_t*>& ls) {
4950
ls.push_back(new inodeno_t(1));
5051
ls.push_back(new inodeno_t(123456789));
@@ -95,9 +96,6 @@ inline bool file_mode_is_readonly(int mode) {
9596
#define MAX_DENTRY_LEN 255
9697

9798
// --
98-
namespace ceph {
99-
class Formatter;
100-
}
10199
void dump(const ceph_file_layout& l, ceph::Formatter *f);
102100
void dump(const ceph_dir_layout& l, ceph::Formatter *f);
103101

0 commit comments

Comments
 (0)