diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-02-12 22:17:38 +0100 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-02-12 22:17:38 +0100 |
commit | 0c65cd5f5e93f2d3db9ac55b74c03a32144d331f (patch) | |
tree | 0ca89145751320d76c132c0edee3287f9b1118eb | |
parent | e2b8e0f13cea1ec0a5688b07032f5a392cce1049 (diff) | |
download | ceph-0c65cd5f5e93f2d3db9ac55b74c03a32144d331f.tar.gz |
mds/LogEvent.h: change print() signature to const
Fix print() function of src/mds/LogEvent.h, declare as
virtual void print(ostream& out) const {...}
Adapt functions of derived classes. This should fix a problem
with print function of derived classes EImportStart and
EImportFinish, which had a const signature, hiding virtual
function of the base class LogEvent (which wasn't const).
Fix -Woverloaded-virtual warning from clang was:
mds/events/EImportStart.h:43:8: warning: 'EImportStart::print'
hides overloaded virtual function [-Woverloaded-virtual]
void print(ostream& out) const {
^
mds/events/../LogEvent.h:95:16: note: hidden overloaded virtual
function 'LogEvent::print' declared here
virtual void print(ostream& out) {
^
In file included from mds/journal.cc:31:
mds/events/EImportFinish.h:35:8: warning: 'EImportFinish::print'
hides overloaded virtual function [-Woverloaded-virtual]
void print(ostream& out) const {
^
mds/events/../LogEvent.h:95:16: note: hidden overloaded
virtual function 'LogEvent::print' declared here
virtual void print(ostream& out) {
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r-- | src/mds/LogEvent.h | 2 | ||||
-rw-r--r-- | src/mds/events/ECommitted.h | 2 | ||||
-rw-r--r-- | src/mds/events/EExport.h | 2 | ||||
-rw-r--r-- | src/mds/events/EFragment.h | 3 | ||||
-rw-r--r-- | src/mds/events/EOpen.h | 2 | ||||
-rw-r--r-- | src/mds/events/EResetJournal.h | 2 | ||||
-rw-r--r-- | src/mds/events/ESession.h | 2 | ||||
-rw-r--r-- | src/mds/events/ESessions.h | 2 | ||||
-rw-r--r-- | src/mds/events/ESlaveUpdate.h | 2 | ||||
-rw-r--r-- | src/mds/events/ESubtreeMap.h | 2 | ||||
-rw-r--r-- | src/mds/events/ETableClient.h | 2 | ||||
-rw-r--r-- | src/mds/events/ETableServer.h | 2 | ||||
-rw-r--r-- | src/mds/events/EUpdate.h | 2 |
13 files changed, 14 insertions, 13 deletions
diff --git a/src/mds/LogEvent.h b/src/mds/LogEvent.h index 25990b6f104..fdf145c85ea 100644 --- a/src/mds/LogEvent.h +++ b/src/mds/LogEvent.h @@ -92,7 +92,7 @@ protected: ENCODE_FINISH(bl); } - virtual void print(ostream& out) { + virtual void print(ostream& out) const { out << "event(" << _type << ")"; } diff --git a/src/mds/events/ECommitted.h b/src/mds/events/ECommitted.h index 0cb933e2389..2889a3b032d 100644 --- a/src/mds/events/ECommitted.h +++ b/src/mds/events/ECommitted.h @@ -26,7 +26,7 @@ public: ECommitted(metareqid_t r) : LogEvent(EVENT_COMMITTED), reqid(r) { } - void print(ostream& out) { + void print(ostream& out) const { out << "ECommitted " << reqid; } diff --git a/src/mds/events/EExport.h b/src/mds/events/EExport.h index 645c790b22d..082e14babb8 100644 --- a/src/mds/events/EExport.h +++ b/src/mds/events/EExport.h @@ -38,7 +38,7 @@ public: set<dirfrag_t> &get_bounds() { return bounds; } - void print(ostream& out) { + void print(ostream& out) const { out << "EExport " << base << " " << metablob; } diff --git a/src/mds/events/EFragment.h b/src/mds/events/EFragment.h index 5524de7827e..bdbbd335e29 100644 --- a/src/mds/events/EFragment.h +++ b/src/mds/events/EFragment.h @@ -30,7 +30,8 @@ public: EFragment(MDLog *mdlog, int o, inodeno_t i, frag_t bf, int b) : LogEvent(EVENT_FRAGMENT), metablob(mdlog), op(o), ino(i), basefrag(bf), bits(b) { } - void print(ostream& out) { + + void print(ostream& out) const { out << "EFragment " << op_name(op) << " " << ino << " " << basefrag << " by " << bits << " " << metablob; } diff --git a/src/mds/events/EOpen.h b/src/mds/events/EOpen.h index 3ec677c14f7..792540ef5da 100644 --- a/src/mds/events/EOpen.h +++ b/src/mds/events/EOpen.h @@ -27,7 +27,7 @@ public: EOpen(MDLog *mdlog) : LogEvent(EVENT_OPEN), metablob(mdlog) { } - void print(ostream& out) { + void print(ostream& out) const { out << "EOpen " << metablob << ", " << inos.size() << " open files"; } diff --git a/src/mds/events/EResetJournal.h b/src/mds/events/EResetJournal.h index 7fc3847d2ad..c782f29a8dd 100644 --- a/src/mds/events/EResetJournal.h +++ b/src/mds/events/EResetJournal.h @@ -28,7 +28,7 @@ class EResetJournal : public LogEvent { void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list<EResetJournal*>& ls); - void print(ostream& out) { + void print(ostream& out) const { out << "EResetJournal"; } diff --git a/src/mds/events/ESession.h b/src/mds/events/ESession.h index e2e269fa429..91ad6c45ae4 100644 --- a/src/mds/events/ESession.h +++ b/src/mds/events/ESession.h @@ -51,7 +51,7 @@ class ESession : public LogEvent { void dump(Formatter *f) const; static void generate_test_instances(list<ESession*>& ls); - void print(ostream& out) { + void print(ostream& out) const { if (open) out << "ESession " << client_inst << " open cmapv " << cmapv; else diff --git a/src/mds/events/ESessions.h b/src/mds/events/ESessions.h index e239a0da8e9..fe943a881fd 100644 --- a/src/mds/events/ESessions.h +++ b/src/mds/events/ESessions.h @@ -48,7 +48,7 @@ public: void dump(Formatter *f) const; static void generate_test_instances(list<ESessions*>& ls); - void print(ostream& out) { + void print(ostream& out) const { out << "ESessions " << client_map.size() << " opens cmapv " << cmapv; } diff --git a/src/mds/events/ESlaveUpdate.h b/src/mds/events/ESlaveUpdate.h index fd32486e8e2..40d9c22f6d4 100644 --- a/src/mds/events/ESlaveUpdate.h +++ b/src/mds/events/ESlaveUpdate.h @@ -123,7 +123,7 @@ public: master(mastermds), op(o), origop(oo) { } - void print(ostream& out) { + void print(ostream& out) const { if (type.length()) out << type << " "; out << " " << (int)op; diff --git a/src/mds/events/ESubtreeMap.h b/src/mds/events/ESubtreeMap.h index 0267a925982..32a4abe5180 100644 --- a/src/mds/events/ESubtreeMap.h +++ b/src/mds/events/ESubtreeMap.h @@ -27,7 +27,7 @@ public: ESubtreeMap() : LogEvent(EVENT_SUBTREEMAP), expire_pos(0) { } - void print(ostream& out) { + void print(ostream& out) const { out << "ESubtreeMap " << subtrees.size() << " subtrees " << ", " << ambiguous_subtrees.size() << " ambiguous " << metablob; diff --git a/src/mds/events/ETableClient.h b/src/mds/events/ETableClient.h index 8486b808cc3..e415e60bd85 100644 --- a/src/mds/events/ETableClient.h +++ b/src/mds/events/ETableClient.h @@ -36,7 +36,7 @@ struct ETableClient : public LogEvent { void dump(Formatter *f) const; static void generate_test_instances(list<ETableClient*>& ls); - void print(ostream& out) { + void print(ostream& out) const { out << "ETableClient " << get_mdstable_name(table) << " " << get_mdstableserver_opname(op); if (tid) out << " tid " << tid; } diff --git a/src/mds/events/ETableServer.h b/src/mds/events/ETableServer.h index ee63e47a416..132d3b6a6c9 100644 --- a/src/mds/events/ETableServer.h +++ b/src/mds/events/ETableServer.h @@ -41,7 +41,7 @@ struct ETableServer : public LogEvent { void dump(Formatter *f) const; static void generate_test_instances(list<ETableServer*>& ls); - void print(ostream& out) { + void print(ostream& out) const { out << "ETableServer " << get_mdstable_name(table) << " " << get_mdstableserver_opname(op); if (reqid) out << " reqid " << reqid; diff --git a/src/mds/events/EUpdate.h b/src/mds/events/EUpdate.h index 79414fe5c7d..645386e2511 100644 --- a/src/mds/events/EUpdate.h +++ b/src/mds/events/EUpdate.h @@ -32,7 +32,7 @@ public: LogEvent(EVENT_UPDATE), metablob(mdlog), type(s), cmapv(0), had_slaves(false) { } - void print(ostream& out) { + void print(ostream& out) const { if (type.length()) out << "EUpdate " << type << " "; out << metablob; |