]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * Ceph - scalable distributed file system | |
5 | * | |
6 | * Copyright (C) 2010 Greg Farnum <gregf@hq.newdream.net> | |
7 | * | |
8 | * This is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU Lesser General Public | |
10 | * License version 2.1, as published by the Free Software | |
11 | * Foundation. See file COPYING. | |
12 | */ | |
13 | ||
14 | #ifndef JOURNAL_DUMPER_H_ | |
15 | #define JOURNAL_DUMPER_H_ | |
16 | ||
17 | ||
18 | #include "MDSUtility.h" | |
19 | ||
20 | class Journaler; | |
21 | ||
22 | /** | |
23 | * This class lets you dump out an mds journal for troubleshooting or whatever. | |
24 | * | |
25 | * It was built to work with cmds so some of the design choices are random. | |
26 | * To use, create a Dumper, call init(), and then call dump() with the name | |
27 | * of the file to dump to. | |
28 | */ | |
29 | ||
30 | class Dumper : public MDSUtility { | |
31 | private: | |
32 | mds_role_t role; | |
33 | inodeno_t ino; | |
34 | ||
35 | public: | |
36 | Dumper() : ino(-1) | |
37 | {} | |
38 | ||
39 | int init(mds_role_t role_); | |
40 | int recover_journal(Journaler *journaler); | |
41 | int dump(const char *dumpfile); | |
91327a77 | 42 | int undump(const char *dumpfile, bool force); |
7c673cae FG |
43 | }; |
44 | ||
45 | #endif /* JOURNAL_DUMPER_H_ */ |