]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/LogEvent.h: change print() signature to const 50/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 12 Feb 2013 21:17:38 +0000 (22:17 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 12 Feb 2013 21:17:38 +0000 (22:17 +0100)
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>
13 files changed:
src/mds/LogEvent.h
src/mds/events/ECommitted.h
src/mds/events/EExport.h
src/mds/events/EFragment.h
src/mds/events/EOpen.h
src/mds/events/EResetJournal.h
src/mds/events/ESession.h
src/mds/events/ESessions.h
src/mds/events/ESlaveUpdate.h
src/mds/events/ESubtreeMap.h
src/mds/events/ETableClient.h
src/mds/events/ETableServer.h
src/mds/events/EUpdate.h

index 25990b6f104d97f61fc6b490051e839193848db5..fdf145c85eaf5ceb650e5572419880c5b6952b0e 100644 (file)
@@ -92,7 +92,7 @@ protected:
     ENCODE_FINISH(bl);
   }
 
-  virtual void print(ostream& out) { 
+  virtual void print(ostream& out) const 
     out << "event(" << _type << ")";
   }
 
index 0cb933e2389b9c50d9f6c6cbe239e0a8bf31659f..2889a3b032d71f21f155839cbe5a029b0002d979 100644 (file)
@@ -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;
   }
 
index 645c790b22d6ec58de1c6fa50a0daa005fa0d96a..082e14babb85bfe833249c66f1060fab56e134ab 100644 (file)
@@ -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;
   }
 
index 5524de7827eeb24d9c7c6ba8d486785309c31f9f..bdbbd335e29f4d8dc5b31174c6afb2c998b74778 100644 (file)
@@ -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;
   }
 
index 3ec677c14f7fc4da82ae30c43cf3ce88e4b7abe5..792540ef5dab17f68014c448b924cd026cee76fd 100644 (file)
@@ -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";
   }
 
index 7fc3847d2adf74ba3971352d33fc536180ddfa8b..c782f29a8dd8c3c7dab8afb033d45890e8b1cbe3 100644 (file)
@@ -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";
   }
 
index e2e269fa4298a521bcd201b202871159fc36cba8..91ad6c45ae43091a0568c22fdd00033dedb807d7 100644 (file)
@@ -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
index e239a0da8e9748d6577de006f03a957929cf5407..fe943a881fd236312655916b4a7174a7b61e2387 100644 (file)
@@ -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;
   }
   
index fd32486e8e26253b6cb45bc174383fc2876ca043..40d9c22f6d47cd8bd27ab4e8076b1bdfb2a982f3 100644 (file)
@@ -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;
index 0267a92598269fe79babc29cff0b3786be4a22eb..32a4abe5180d3a1fad359ae81429376163559afb 100644 (file)
@@ -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;
index 8486b808cc3c1817494f373317e9f257b5171a50..e415e60bd853516b4ed3e7319aa681e6327ec30c 100644 (file)
@@ -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;
   }  
index ee63e47a416248c062c2a197a58d7d1819d2cd9b..132d3b6a6c90c8586e9b91d96b33c6cb669298bf 100644 (file)
@@ -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;
index 79414fe5c7d329b9bcd2d292cb3b243e0f4e057e..645386e2511fd375ba1fa45917b6e20cad504c36 100644 (file)
@@ -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;