]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add override in headers 13691/head
authorliuchang0812 <liuchang0812@gmail.com>
Wed, 22 Feb 2017 09:53:18 +0000 (17:53 +0800)
committerliuchang0812 <liuchang0812@gmail.com>
Fri, 3 Mar 2017 07:24:00 +0000 (15:24 +0800)
LLVM has a tool called clang-tidy, that it could do a lot of things base on
semantic analyse.  We could use following command to add override automatically:
clang-tidy -checks="-*, modernize-use-override" a.cpp -- -std=c++11

Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
32 files changed:
src/mds/Beacon.h
src/mds/CDentry.h
src/mds/CDir.h
src/mds/CInode.cc
src/mds/CInode.h
src/mds/LocalLock.h
src/mds/MDCache.h
src/mds/MDLog.h
src/mds/MDSContext.h
src/mds/MDSDaemon.h
src/mds/MDSRank.h
src/mds/MDSTableServer.h
src/mds/Mutation.h
src/mds/ScatterLock.h
src/mds/ScrubStack.h
src/mds/SessionMap.h
src/mds/SnapClient.h
src/mds/events/ECommitted.h
src/mds/events/EExport.h
src/mds/events/EFragment.h
src/mds/events/EImportFinish.h
src/mds/events/EImportStart.h
src/mds/events/ENoOp.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 17ad0c6711828cf66594598e5fda2a0877978649..571f7f5599564859437732df165ef768bb42a520 100644 (file)
@@ -41,16 +41,16 @@ class Beacon : public Dispatcher
 {
 public:
   Beacon(CephContext *cct_, MonClient *monc_, std::string name);
-  ~Beacon();
+  ~Beacon() override;
 
   void init(MDSMap const *mdsmap);
   void shutdown();
 
-  bool ms_dispatch(Message *m);
-  void ms_handle_connect(Connection *c) {}
-  bool ms_handle_reset(Connection *c) {return false;}
-  void ms_handle_remote_reset(Connection *c) {}
-  bool ms_handle_refused(Connection *c) {return false;}
+  bool ms_dispatch(Message *m) override;
+  void ms_handle_connect(Connection *c) override {}
+  bool ms_handle_reset(Connection *c) override {return false;}
+  void ms_handle_remote_reset(Connection *c) override {}
+  bool ms_handle_refused(Connection *c) override {return false;}
 
   void notify_mdsmap(MDSMap const *mdsmap);
   void notify_health(MDSRank const *mds);
index 42c6dcb880a28323017e843f3baea8bcc03e5504..3d300237f6a7b4099e9820dee567dc600bfb6e76 100644 (file)
@@ -131,7 +131,7 @@ public:
     pool.free(p);
   }
 
-  const char *pin_name(int p) const {
+  const char *pin_name(int p) const override {
     switch (p) {
     case PIN_INODEPIN: return "inodepin";
     case PIN_FRAGMENTING: return "fragmenting";
@@ -144,9 +144,9 @@ public:
   // -- wait --
   //static const int WAIT_LOCK_OFFSET = 8;
 
-  void add_waiter(uint64_t tag, MDSInternalContextBase *c);
+  void add_waiter(uint64_t tag, MDSInternalContextBase *c) override;
 
-  bool is_lt(const MDSCacheObject *r) const {
+  bool is_lt(const MDSCacheObject *r) const override {
     return *this < *static_cast<const CDentry*>(r);
   }
 
@@ -206,21 +206,21 @@ public:
   }
 
   // ref counts: pin ourselves in the LRU when we're pinned.
-  void first_get() {
+  void first_get() override {
     lru_pin();
   }
-  void last_put() {
+  void last_put() override {
     lru_unpin();
   }
-  void _put();
+  void _put() override;
 
   // auth pins
-  bool can_auth_pin() const;
-  void auth_pin(void *by);
-  void auth_unpin(void *by);
+  bool can_auth_pin() const override;
+  void auth_pin(void *by) override;
+  void auth_unpin(void *by) override;
   void adjust_nested_auth_pins(int adjustment, int diradj, void *by);
-  bool is_frozen() const;
-  bool is_freezing() const;
+  bool is_frozen() const override;
+  bool is_freezing() const override;
   int get_num_dir_auth_pins() const;
   
   // remote links
@@ -241,7 +241,7 @@ public:
   version_t get_projected_version() const { return projected_version; }
   void set_projected_version(version_t v) { projected_version = v; }
   
-  mds_authority_t authority() const;
+  mds_authority_t authority() const override;
 
   version_t pre_dirty(version_t min=0);
   void _mark_dirty(LogSegment *ls);
@@ -311,13 +311,13 @@ public:
   }
 
   // -- locking --
-  SimpleLock* get_lock(int type) {
+  SimpleLock* get_lock(int type) override {
     assert(type == CEPH_LOCK_DN);
     return &lock;
   }
-  void set_object_info(MDSCacheObjectInfo &info);
-  void encode_lock_state(int type, bufferlist& bl);
-  void decode_lock_state(int type, bufferlist& bl);
+  void set_object_info(MDSCacheObjectInfo &info) override;
+  void encode_lock_state(int type, bufferlist& bl) override;
+  void decode_lock_state(int type, bufferlist& bl) override;
 
   // ---------------------------------------------
   // replicas (on clients)
@@ -347,8 +347,8 @@ public:
   void remove_client_lease(ClientLease *r, Locker *locker);  // returns remaining mask (if any), and kicks locker eval_gathers
   void remove_client_leases(Locker *locker);
 
-  ostream& print_db_line_prefix(ostream& out);
-  void print(ostream& out);
+  ostream& print_db_line_prefix(ostream& out) override;
+  void print(ostream& out) override;
   void dump(Formatter *f) const;
 
 
index 06ae9a487b664e268051f0a031204838bf7a5c66..f8d11b38985299172387f7565ffb25c634500f85 100644 (file)
@@ -76,7 +76,7 @@ public:
   static const int PIN_EXPORTBOUND = 10;
   static const int PIN_STICKY =      11;
   static const int PIN_SUBTREETEMP = 12;  // used by MDCache::trim_non_auth()
-  const char *pin_name(int p) const {
+  const char *pin_name(int p) const override {
     switch (p) {
     case PIN_DNWAITER: return "dnwaiter";
     case PIN_INOWAITER: return "inowaiter";
@@ -169,7 +169,7 @@ public:
   CInode          *inode;  // my inode
   frag_t           frag;   // my frag
 
-  bool is_lt(const MDSCacheObject *r) const {
+  bool is_lt(const MDSCacheObject *r) const override {
     return dirfrag() < (static_cast<const CDir*>(r))->dirfrag();
   }
 
@@ -518,7 +518,7 @@ private:
   std::string get_path() const;
 
  public:
-  mds_authority_t authority() const;
+  mds_authority_t authority() const override;
   mds_authority_t get_dir_auth() const { return dir_auth; }
   void set_dir_auth(mds_authority_t a);
   void set_dir_auth(mds_rank_t a) { set_dir_auth(mds_authority_t(a, CDIR_AUTH_UNKNOWN)); }
@@ -664,8 +664,8 @@ public:
 
 
   // -- reference counting --
-  void first_get();
-  void last_put();
+  void first_get() override;
+  void last_put() override;
 
   void request_pin_get() {
     if (request_pins == 0) get(PIN_REQUEST);
@@ -688,8 +688,8 @@ public:
   void take_dentry_waiting(const std::string& dentry, snapid_t first, snapid_t last, std::list<MDSInternalContextBase*>& ls);
   void take_sub_waiting(std::list<MDSInternalContextBase*>& ls);  // dentry or ino
 
-  void add_waiter(uint64_t mask, MDSInternalContextBase *c);
-  void take_waiting(uint64_t mask, std::list<MDSInternalContextBase*>& ls);  // may include dentry waiters
+  void add_waiter(uint64_t mask, MDSInternalContextBase *c) override;
+  void take_waiting(uint64_t mask, std::list<MDSInternalContextBase*>& ls) override;  // may include dentry waiters
   void finish_waiting(uint64_t mask, int result = 0);    // ditto
   
 
@@ -702,13 +702,13 @@ public:
   void decode_import(bufferlist::iterator& blp, utime_t now, LogSegment *ls);
 
   // -- auth pins --
-  bool can_auth_pin() const { return is_auth() && !(is_frozen() || is_freezing()); }
+  bool can_auth_pin() const override { return is_auth() && !(is_frozen() || is_freezing()); }
   int get_cum_auth_pins() const { return auth_pins + nested_auth_pins; }
   int get_auth_pins() const { return auth_pins; }
   int get_nested_auth_pins() const { return nested_auth_pins; }
   int get_dir_auth_pins() const { return dir_auth_pins; }
-  void auth_pin(void *who);
-  void auth_unpin(void *who);
+  void auth_pin(void *who) override;
+  void auth_unpin(void *who) override;
 
   void adjust_nested_auth_pins(int inc, int dirinc, void *by);
   void verify_fragstat();
@@ -724,12 +724,12 @@ public:
 
   void maybe_finish_freeze();
 
-  bool is_freezing() const { return is_freezing_tree() || is_freezing_dir(); }
+  bool is_freezing() const override { return is_freezing_tree() || is_freezing_dir(); }
   bool is_freezing_tree() const;
   bool is_freezing_tree_root() const { return state & STATE_FREEZINGTREE; }
   bool is_freezing_dir() const { return state & STATE_FREEZINGDIR; }
 
-  bool is_frozen() const { return is_frozen_dir() || is_frozen_tree(); }
+  bool is_frozen() const override { return is_frozen_dir() || is_frozen_tree(); }
   bool is_frozen_tree() const;
   bool is_frozen_tree_root() const { return state & STATE_FROZENTREE; }
   bool is_frozen_dir() const { return state & STATE_FROZENDIR; }
@@ -759,8 +759,8 @@ public:
   CDir *get_frozen_tree_root();
 
 
-  ostream& print_db_line_prefix(ostream& out);
-  void print(ostream& out);
+  ostream& print_db_line_prefix(ostream& out) override;
+  void print(ostream& out) override;
   void dump(Formatter *f) const;
 };
 
index 1f27f9a22220206a600225fbf452e7e47041dc31..89a7eb1f7dc04b4fa78a8a2fc48ca3297e03b204 100644 (file)
@@ -3755,7 +3755,7 @@ void CInode::validate_disk_state(CInode::validated_data *results,
       set_callback(DIRFRAGS, static_cast<Continuation::stagePtr>(&ValidationContinuation::_dirfrags));
     }
 
-    ~ValidationContinuation() {
+    ~ValidationContinuation() override {
       delete shadow_in;
     }
 
index 484aed549e077ba58c2918e07e76774bc0862c3d..fbcd575ffb08faace5ba42406f529a3c06379ec3 100644 (file)
@@ -175,7 +175,7 @@ public:
   static const int PIN_DIRWAITER =        24;
   static const int PIN_SCRUBQUEUE =       25;
 
-  const char *pin_name(int p) const {
+  const char *pin_name(int p) const override {
     switch (p) {
     case PIN_DIRFRAG: return "dirfrag";
     case PIN_CAPS: return "caps";
@@ -240,7 +240,7 @@ public:
   // misc
   static const unsigned EXPORT_NONCE = 1; // nonce given to replicas created by export
 
-  ostream& print_db_line_prefix(ostream& out);
+  ostream& print_db_line_prefix(ostream& out) override;
 
  public:
   MDCache *mdcache;
@@ -685,7 +685,7 @@ public:
     state = 0;  
     if (auth) state_set(STATE_AUTH);
   }
-  ~CInode() {
+  ~CInode() override {
     close_dirfrags();
     close_snaprealm();
     clear_file_locks();
@@ -730,7 +730,7 @@ public:
   CDir *get_projected_parent_dir();
   CInode *get_parent_inode();
   
-  bool is_lt(const MDSCacheObject *r) const {
+  bool is_lt(const MDSCacheObject *r) const override {
     const CInode *o = static_cast<const CInode*>(r);
     return ino() < o->ino() ||
       (ino() == o->ino() && last < o->last);
@@ -820,8 +820,8 @@ public:
   bool is_waiting_for_dir(frag_t fg) {
     return waiting_on_dir.count(fg);
   }
-  void add_waiter(uint64_t tag, MDSInternalContextBase *c);
-  void take_waiting(uint64_t tag, std::list<MDSInternalContextBase*>& ls);
+  void add_waiter(uint64_t tag, MDSInternalContextBase *c) override;
+  void take_waiting(uint64_t tag, std::list<MDSInternalContextBase*>& ls) override;
 
   // -- encode/decode helpers --
   void _encode_base(bufferlist& bl, uint64_t features);
@@ -877,7 +877,7 @@ public:
   SimpleLock flocklock;
   SimpleLock policylock;
 
-  SimpleLock* get_lock(int type) {
+  SimpleLock* get_lock(int type) override {
     switch (type) {
     case CEPH_LOCK_IFILE: return &filelock;
     case CEPH_LOCK_IAUTH: return &authlock;
@@ -892,13 +892,13 @@ public:
     return 0;
   }
 
-  void set_object_info(MDSCacheObjectInfo &info);
-  void encode_lock_state(int type, bufferlist& bl);
-  void decode_lock_state(int type, bufferlist& bl);
+  void set_object_info(MDSCacheObjectInfo &info) override;
+  void encode_lock_state(int type, bufferlist& bl) override;
+  void decode_lock_state(int type, bufferlist& bl) override;
 
   void _finish_frag_update(CDir *dir, MutationRef& mut);
 
-  void clear_dirty_scattered(int type);
+  void clear_dirty_scattered(int type) override;
   bool is_dirty_scattered();
   void clear_scatter_dirty();  // on rejoin ack
 
@@ -1009,21 +1009,21 @@ public:
   void replicate_relax_locks();
 
   // -- authority --
-  mds_authority_t authority() const;
+  mds_authority_t authority() const override;
 
   // -- auth pins --
   void adjust_nested_auth_pins(int a, void *by);
-  bool can_auth_pin() const;
-  void auth_pin(void *by);
-  void auth_unpin(void *by);
+  bool can_auth_pin() const override;
+  void auth_pin(void *by) override;
+  void auth_unpin(void *by) override;
 
   // -- freeze --
   bool is_freezing_inode() const { return state_test(STATE_FREEZING); }
   bool is_frozen_inode() const { return state_test(STATE_FROZEN); }
   bool is_frozen_auth_pin() const { return state_test(STATE_FROZENAUTHPIN); }
-  bool is_frozen() const;
+  bool is_frozen() const override;
   bool is_frozen_dir() const;
-  bool is_freezing() const;
+  bool is_freezing() const override;
 
   /* Freeze the inode. auth_pin_allowance lets the caller account for any
    * auth_pins it is itself holding/responsible for. */
@@ -1035,7 +1035,7 @@ public:
   void unfreeze_auth_pin();
 
   // -- reference counting --
-  void bad_put(int by) {
+  void bad_put(int by) override {
     generic_dout(0) << " bad put " << *this << " by " << by << " " << pin_name(by) << " was " << ref
 #ifdef MDS_REF_SET
                    << " (" << ref_map << ")"
@@ -1046,7 +1046,7 @@ public:
 #endif
     assert(ref > 0);
   }
-  void bad_get(int by) {
+  void bad_get(int by) override {
     generic_dout(0) << " bad get " << *this << " by " << by << " " << pin_name(by) << " was " << ref
 #ifdef MDS_REF_SET
                    << " (" << ref_map << ")"
@@ -1056,9 +1056,9 @@ public:
     assert(ref_map[by] >= 0);
 #endif
   }
-  void first_get();
-  void last_put();
-  void _put();
+  void first_get() override;
+  void last_put() override;
+  void _put() override;
 
 
   // -- hierarchy stuff --
@@ -1086,7 +1086,7 @@ public:
     projected_parent.pop_front();
   }
 
-  void print(ostream& out);
+  void print(ostream& out) override;
   void dump(Formatter *f) const;
 
   /**
index e12ab9a7506cbdfb53144d99b1a5ff6051abc3a0..6609827165e78e91aa50b3b417237a6b73ca0ab7 100644 (file)
@@ -27,7 +27,7 @@ public:
     set_state(LOCK_LOCK); // always.
   }
 
-  bool is_locallock() const {
+  bool is_locallock() const override {
     return true;
   }
 
@@ -52,7 +52,7 @@ public:
     return last_wrlock_client;
   }
   
-  virtual void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "(";
     _print(out);
     if (last_wrlock_client >= 0)
index 8f0d4bb02e0809a4d2b0cd064b7cb10ad6b6db0a..4e146281c32895353d5199e440420e86fcf9e4c6 100644 (file)
@@ -1195,7 +1195,7 @@ class C_MDS_RetryRequest : public MDSInternalContext {
   MDRequestRef mdr;
  public:
   C_MDS_RetryRequest(MDCache *c, MDRequestRef& r);
-  virtual void finish(int r);
+  void finish(int r) override;
 };
 
 #endif
index 0060c3a2364ef553d514d8539da5fe76ce5943b1..5579e5abc007bde82ef30359d0d9ea476a437798 100644 (file)
@@ -89,7 +89,7 @@ protected:
     MDLog *log;
   public:
     explicit ReplayThread(MDLog *l) : log(l) {}
-    void* entry() {
+    void* entry() override {
       log->_replay_thread();
       return 0;
     }
@@ -111,7 +111,7 @@ protected:
   public:
     void set_completion(MDSInternalContextBase *c) {completion = c;}
     explicit RecoveryThread(MDLog *l) : log(l), completion(NULL) {}
-    void* entry() {
+    void* entry() override {
       log->_recovery_thread(completion);
       return 0;
     }
@@ -152,7 +152,7 @@ protected:
     MDLog *log;
   public:
     explicit SubmitThread(MDLog *l) : log(l) {}
-    void* entry() {
+    void* entry() override {
       log->_submit_thread();
       return 0;
     }
index e021906463a60b309b648e852f9478e9a9ac6249..ca48ad4a151c5fa5d9ca705c397f7b6b07a22a10 100644 (file)
@@ -42,7 +42,7 @@ protected:
 class MDSInternalContextBase : public MDSContext
 {
 public:
-    void complete(int r);
+    void complete(int r) override;
 };
 
 /**
@@ -52,7 +52,7 @@ class MDSInternalContext : public MDSInternalContextBase
 {
 protected:
   MDSRank *mds;
-  virtual MDSRank* get_mds();
+  MDSRank* get_mds() override;
 
 public:
   explicit MDSInternalContext(MDSRank *mds_) : mds(mds_) {
@@ -69,16 +69,16 @@ class MDSInternalContextWrapper : public MDSInternalContextBase
 protected:
   MDSRank *mds;
   Context *fin;
-  MDSRank *get_mds();
+  MDSRank *get_mds() override;
 public:
   MDSInternalContextWrapper(MDSRank *m, Context *c) : mds(m), fin(c) {}
-  void finish(int r);
+  void finish(int r) override;
 };
 
 class MDSIOContextBase : public MDSContext
 {
 public:
-  void complete(int r);
+  void complete(int r) override;
 };
 
 /**
@@ -105,7 +105,7 @@ class MDSIOContext : public MDSIOContextBase
 {
 protected:
   MDSRank *mds;
-  virtual MDSRank* get_mds();
+  MDSRank* get_mds() override;
 
 public:
   explicit MDSIOContext(MDSRank *mds_) : mds(mds_) {
@@ -122,10 +122,10 @@ class MDSIOContextWrapper : public MDSIOContextBase
 protected:
   MDSRank *mds;
   Context *fin;
-  MDSRank *get_mds();
+  MDSRank *get_mds() override;
 public:
   MDSIOContextWrapper(MDSRank *m, Context *c) : mds(m), fin(c) {}
-  void finish(int r);
+  void finish(int r) override;
 };
 
 /**
@@ -133,10 +133,10 @@ public:
  */
 class C_MDSInternalNoop : public MDSInternalContextBase
 {
-  virtual MDSRank* get_mds() {ceph_abort();}
+  MDSRank* get_mds() override {ceph_abort();}
 public:
-  void finish(int r) {}
-  void complete(int r) {}
+  void finish(int r) override {}
+  void complete(int r) override {}
 };
 
 
@@ -149,7 +149,7 @@ class C_IO_Wrapper : public MDSIOContext
 protected:
   bool async;
   MDSInternalContextBase *wrapped;
-  virtual void finish(int r) {
+  void finish(int r) override {
     wrapped->complete(r);
     wrapped = nullptr;
   }
@@ -159,13 +159,13 @@ public:
     assert(wrapped != NULL);
   }
 
-  ~C_IO_Wrapper() {
+  ~C_IO_Wrapper() override {
     if (wrapped != nullptr) {
       delete wrapped;
       wrapped = nullptr;
     }
   }
-  virtual void complete(int r) final;
+  void complete(int r) final;
 };
 
 
@@ -175,7 +175,7 @@ public:
 class MDSInternalContextGather : public MDSInternalContextBase
 {
 protected:
-  MDSRank *get_mds();
+  MDSRank *get_mds() override;
 };
 
 
@@ -184,7 +184,7 @@ class MDSGather : public C_GatherBase<MDSInternalContextBase, MDSInternalContext
 public:
   MDSGather(CephContext *cct, MDSInternalContextBase *onfinish) : C_GatherBase<MDSInternalContextBase, MDSInternalContextGather>(cct, onfinish) {}
 protected:
-  virtual MDSRank *get_mds() {return NULL;}
+  MDSRank *get_mds() override {return NULL;}
 };
 
 
index 375cf8abaaec5264a9b414cbb11e16ec7a4a7b54..71f861bd8b45a2c9f8510577360b543715783d40 100644 (file)
@@ -91,7 +91,7 @@ class MDSDaemon : public Dispatcher, public md_config_obs_t {
 
  public:
   MDSDaemon(const std::string &n, Messenger *m, MonClient *mc);
-  ~MDSDaemon();
+  ~MDSDaemon() override;
   int orig_argc;
   const char **orig_argv;
 
@@ -109,9 +109,9 @@ class MDSDaemon : public Dispatcher, public md_config_obs_t {
   bool is_clean_shutdown();
 
   // config observer bits
-  virtual const char** get_tracked_conf_keys() const;
-  virtual void handle_conf_change(const struct md_config_t *conf,
-                                 const std::set <std::string> &changed);
+  const char** get_tracked_conf_keys() const override;
+  void handle_conf_change(const struct md_config_t *conf,
+                                 const std::set <std::string> &changed) override;
  protected:
   // tick and other timer fun
   class C_MDS_Tick;
@@ -121,16 +121,16 @@ class MDSDaemon : public Dispatcher, public md_config_obs_t {
   void wait_for_omap_osds();
 
  private:
-  bool ms_dispatch(Message *m);
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new);
+  bool ms_dispatch(Message *m) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override;
   bool ms_verify_authorizer(Connection *con, int peer_type,
                               int protocol, bufferlist& authorizer_data, bufferlist& authorizer_reply,
-                              bool& isvalid, CryptoKey& session_key);
-  void ms_handle_accept(Connection *con);
-  void ms_handle_connect(Connection *con);
-  bool ms_handle_reset(Connection *con);
-  void ms_handle_remote_reset(Connection *con);
-  bool ms_handle_refused(Connection *con);
+                              bool& isvalid, CryptoKey& session_key) override;
+  void ms_handle_accept(Connection *con) override;
+  void ms_handle_connect(Connection *con) override;
+  bool ms_handle_reset(Connection *con) override;
+  void ms_handle_remote_reset(Connection *con) override;
+  bool ms_handle_refused(Connection *con) override;
 
  protected:
   // admin socket handling
index 190592eabf5d9c1164b622fa2fb561a6e6189a7b..4708311c9d6dc7f9813140faa90e6fc906597fab 100644 (file)
@@ -477,7 +477,7 @@ public:
     assert(m);
     this->m = m;
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     mds->retry_dispatch(m);
   }
 };
index ee569392cb420efa5d9b8eddde94040de29cd364..f7de717c87d8f29469aa93f9ae8ccc2e4390201b 100644 (file)
@@ -58,7 +58,7 @@ private:
   
 
   MDSTableServer(MDSRank *m, int tab) : MDSTable(m, get_mdstable_name(tab), false), table(tab) {}
-  virtual ~MDSTableServer() {}
+  ~MDSTableServer() override {}
 
   void handle_request(MMDSTableRequest *m);
   void do_server_update(bufferlist& bl);
@@ -66,11 +66,11 @@ private:
   virtual void encode_server_state(bufferlist& bl) const = 0;
   virtual void decode_server_state(bufferlist::iterator& bl) = 0;
 
-  void encode_state(bufferlist& bl) const {
+  void encode_state(bufferlist& bl) const override {
     encode_server_state(bl);
     ::encode(pending_for_mds, bl);
   }
-  void decode_state(bufferlist::iterator& bl) {
+  void decode_state(bufferlist::iterator& bl) override {
     decode_server_state(bl);
     ::decode(pending_for_mds, bl);
   }
index e5df22d135a9e11ced61a5d9b43953237289acf2..56b410fe6a736d6147e9f61ec8496f8044ffc2b6 100644 (file)
@@ -92,7 +92,7 @@ public:
     : TrackedOp(tracker, initiated),
       reqid(ri), attempt(att),
       slave_to_mds(slave_to) { }
-  virtual ~MutationImpl() {
+  ~MutationImpl() override {
     assert(locking == NULL);
     assert(pins.empty());
     assert(auth_pins.empty());
@@ -313,7 +313,7 @@ struct MDRequestImpl : public MutationImpl {
     if (!params.dispatched.is_zero())
       mark_event("dispatched", params.dispatched);
   }
-  ~MDRequestImpl();
+  ~MDRequestImpl() override;
   
   More* more();
   bool has_more() const;
@@ -339,8 +339,8 @@ struct MDRequestImpl : public MutationImpl {
   // TrackedOp stuff
   typedef boost::intrusive_ptr<MDRequestImpl> Ref;
 protected:
-  void _dump(Formatter *f) const;
-  void _dump_op_descriptor_unlocked(ostream& stream) const;
+  void _dump(Formatter *f) const override;
+  void _dump_op_descriptor_unlocked(ostream& stream) const override;
 };
 
 typedef boost::intrusive_ptr<MDRequestImpl> MDRequestRef;
index 210557837e11799fcdb73f3a4a423a68694811f6..62f01d26976f861fff4644bc6584e219f0befd94 100644 (file)
@@ -64,14 +64,14 @@ public:
   ScatterLock(MDSCacheObject *o, LockType *lt) : 
     SimpleLock(o, lt), _more(NULL)
   {}
-  ~ScatterLock() {
+  ~ScatterLock() override {
     if (_more) {
       _more->item_updated.remove_myself();   // FIXME this should happen sooner, i think...
       delete _more;
     }
   }
 
-  bool is_scatterlock() const {
+  bool is_scatterlock() const override {
     return true;
   }
 
@@ -135,13 +135,13 @@ public:
     return have_more() ? _more->state_flags & UNSCATTER_WANTED : false;
   }
 
-  bool is_dirty() const {
+  bool is_dirty() const override {
     return have_more() ? _more->state_flags & DIRTY : false;
   }
-  bool is_flushing() const {
+  bool is_flushing() const override {
     return have_more() ? _more->state_flags & FLUSHING: false;
   }
-  bool is_flushed() const {
+  bool is_flushed() const override {
     return have_more() ? _more->state_flags & FLUSHED: false;
   }
   bool is_dirty_or_flushing() const {
@@ -175,7 +175,7 @@ public:
     start_flush();
     finish_flush();
   }
-  void clear_flushed() {
+  void clear_flushed() override {
     if (have_more()) {
       _more->state_flags &= ~FLUSHED;
       try_clear_more();
@@ -228,7 +228,7 @@ public:
     return SimpleLock::remove_replica(from);
   }
 
-  virtual void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "(";
     _print(out);
     if (is_dirty())
index d12b847367c6a550573e766aa1a357c85679a891..c35b1aa9c4632c4a97518991f272410d205242f2 100644 (file)
@@ -42,8 +42,8 @@ protected:
     ScrubStack *stack;
   public:
     C_KickOffScrubs(MDCache *mdcache, ScrubStack *s);
-    void finish(int r) { }
-    void complete(int r) {
+    void finish(int r) override { }
+    void complete(int r) override {
       stack->scrubs_in_progress--;
       stack->kick_off_scrubs();
       // don't delete self
index 4816b012849fcbcea5426602a41bd26d0717e5e9..d4f35083ac642a296d0f44c04e7fcbe0e26d5ff9 100644 (file)
@@ -329,7 +329,7 @@ public:
     completed_requests_dirty(false),
     num_trim_flushes_warnings(0),
     num_trim_requests_warnings(0) { }
-  ~Session() {
+  ~Session() override {
     assert(!item_session_list.is_on_list());
     while (!preopen_out_queue.empty()) {
       preopen_out_queue.front()->put();
@@ -450,7 +450,7 @@ public:
                        loaded_legacy(false)
   { }
 
-  ~SessionMap()
+  ~SessionMap() override
   {
     for (auto p : by_state)
       delete p.second;
@@ -490,7 +490,7 @@ public:
   }
 
   // sessions
-  void decode_legacy(bufferlist::iterator& blp);
+  void decode_legacy(bufferlist::iterator& blp) override;
   bool empty() const { return session_map.empty(); }
   const ceph::unordered_map<entity_name_t, Session*> &get_sessions() const
   {
index 800538c8b136e8392dd94f2d0cf24926f0c5ea6d..64a18e666042ca0d57b833bffbc69cc4823189e6 100644 (file)
@@ -26,8 +26,8 @@ class SnapClient : public MDSTableClient {
 public:
   explicit SnapClient(MDSRank *m) : MDSTableClient(m, TABLE_SNAP) {}
 
-  void resend_queries() {}
-  void handle_query_result(MMDSTableRequest *m) {}
+  void resend_queries() override {}
+  void handle_query_result(MMDSTableRequest *m) override {}
 
   void prepare_create(inodeno_t dirino, const string& name, utime_t stamp,
                      version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
index 67e312c9918b488fc1a16e137f025e08533bf782..19868414fc95261de620f556c43073186088849e 100644 (file)
@@ -26,17 +26,17 @@ public:
   explicit ECommitted(metareqid_t r) :
     LogEvent(EVENT_COMMITTED), reqid(r) { }
 
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "ECommitted " << reqid;
   }
 
-  void encode(bufferlist &bl, uint64_t features) const;
-  void decode(bufferlist::iterator &bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist &bl, uint64_t features) const override;
+  void decode(bufferlist::iterator &bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<ECommitted*>& ls);
 
-  void update_segment() {}
-  void replay(MDSRank *mds);
+  void update_segment() override {}
+  void replay(MDSRank *mds) override;
 };
 WRITE_CLASS_ENCODER_FEATURES(ECommitted)
 
index 0690aec2f5a6e55346c211744e5f1a7a68578630..6021240129e13a91239f95e04c4fa28d138194ec 100644 (file)
@@ -38,17 +38,17 @@ public:
   
   set<dirfrag_t> &get_bounds() { return bounds; }
   
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "EExport " << base << " " << metablob;
   }
 
-  EMetaBlob *get_metablob() { return &metablob; }
+  EMetaBlob *get_metablob() override { return &metablob; }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator &bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator &bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<EExport*>& ls);
-  void replay(MDSRank *mds);
+  void replay(MDSRank *mds) override;
 
 };
 WRITE_CLASS_ENCODER_FEATURES(EExport)
index cb3111c8a3f776876e96647cd85b9bbb0f1ff5d9..ad6f591ca3964283a3d7580bcc6f524efc67a3f9 100644 (file)
@@ -41,7 +41,7 @@ public:
     LogEvent(EVENT_FRAGMENT), metablob(mdlog), 
     op(o), ino(df.ino), basefrag(df.frag), bits(b) { }
 
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "EFragment " << op_name(op) << " " << ino << " " << basefrag << " by " << bits << " " << metablob;
   }
 
@@ -67,13 +67,13 @@ public:
       ::encode(*drb, rollback);
   }
 
-  EMetaBlob *get_metablob() { return &metablob; }
+  EMetaBlob *get_metablob() override { return &metablob; }
 
-  void encode(bufferlist &bl, uint64_t features) const;
-  void decode(bufferlist::iterator &bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist &bl, uint64_t features) const override;
+  void decode(bufferlist::iterator &bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<EFragment*>& ls);
-  void replay(MDSRank *mds);
+  void replay(MDSRank *mds) override;
 };
 WRITE_CLASS_ENCODER_FEATURES(EFragment)
 
index bd04ef516cc9099d411e973b5c29128f32ab218c..16c4d931dcd4fbe4dca9eb45a577c8bff5fb17ad 100644 (file)
@@ -32,7 +32,7 @@ class EImportFinish : public LogEvent {
                                     success(s) { }
   EImportFinish() : LogEvent(EVENT_IMPORTFINISH), base(), success(false) { }
   
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "EImportFinish " << base;
     if (success)
       out << " success";
@@ -40,12 +40,12 @@ class EImportFinish : public LogEvent {
       out << " failed";
   }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator &bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator &bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<EImportFinish*>& ls);
   
-  void replay(MDSRank *mds);
+  void replay(MDSRank *mds) override;
 
 };
 WRITE_CLASS_ENCODER_FEATURES(EImportFinish)
index cebf8481a289a1a5f7c3ff7329b8b135b76d8e2a..36f07b4510f953eae877e2a91e99f47738c3a026 100644 (file)
@@ -41,19 +41,19 @@ protected:
                                       metablob(log) { }
   EImportStart() : LogEvent(EVENT_IMPORTSTART) { }
   
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "EImportStart " << base << " " << metablob;
   }
 
-  EMetaBlob *get_metablob() { return &metablob; }
+  EMetaBlob *get_metablob() override { return &metablob; }
   
-  void encode(bufferlist &bl, uint64_t features) const;
-  void decode(bufferlist::iterator &bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist &bl, uint64_t features) const override;
+  void decode(bufferlist::iterator &bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<EImportStart*>& ls);
   
-  void update_segment();
-  void replay(MDSRank *mds);
+  void update_segment() override;
+  void replay(MDSRank *mds) override;
 
 };
 WRITE_CLASS_ENCODER_FEATURES(EImportStart)
index 4b26fe6214f41f43e4dd14fffcaed6aff1ce5ba4..9a1507043054ac615be97ff4aa83dfe9c2b0d525 100644 (file)
@@ -24,11 +24,11 @@ public:
   ENoOp() : LogEvent(EVENT_NOOP), pad_size(0) { }
   explicit ENoOp(uint32_t size_) : LogEvent(EVENT_NOOP), pad_size(size_){ }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator& bl);
-  void dump(Formatter *f) const {}
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator& bl) override;
+  void dump(Formatter *f) const override {}
 
-  void replay(MDSRank *mds);
+  void replay(MDSRank *mds) override;
 };
 WRITE_CLASS_ENCODER_FEATURES(ENoOp)
 
index 601652a5e951598bcf49abbc2157c29bb8d15144..b529f05c78702894d77549f74431b92d6781b3ef 100644 (file)
@@ -28,11 +28,11 @@ public:
   explicit EOpen(MDLog *mdlog) :
     LogEvent(EVENT_OPEN), metablob(mdlog) { }
 
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "EOpen " << metablob << ", " << inos.size() << " open files";
   }
 
-  EMetaBlob *get_metablob() { return &metablob; }
+  EMetaBlob *get_metablob() override { return &metablob; }
 
   void add_clean_inode(CInode *in) {
     if (!in->is_base()) {
@@ -48,13 +48,13 @@ public:
     inos.push_back(ino);
   }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator& bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator& bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<EOpen*>& ls);
 
-  void update_segment();
-  void replay(MDSRank *mds);
+  void update_segment() override;
+  void replay(MDSRank *mds) override;
 };
 WRITE_CLASS_ENCODER_FEATURES(EOpen)
 
index 717781e0cd71a98efca93e8b2594566787cd3b51..be14b608524dae93c6a304ec146dc5b8a3d254f4 100644 (file)
 class EResetJournal : public LogEvent {
  public:
   EResetJournal() : LogEvent(EVENT_RESETJOURNAL) { }
-  ~EResetJournal() {}
+  ~EResetJournal() override {}
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator& bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator& bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<EResetJournal*>& ls);
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "EResetJournal";
   }
 
-  void replay(MDSRank *mds);
+  void replay(MDSRank *mds) override;
 };
 WRITE_CLASS_ENCODER_FEATURES(EResetJournal)
 
index 9fe6b6fc38b0bc267ae1aab879d0af495fd531b3..83b9a8fc0fd5b985a9fa122d17afad7f03aaa150 100644 (file)
@@ -51,12 +51,12 @@ class ESession : public LogEvent {
     cmapv(v),
     inos(i), inotablev(iv) { }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator& bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator& bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<ESession*>& ls);
 
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     if (open)
       out << "ESession " << client_inst << " open cmapv " << cmapv;
     else
@@ -65,8 +65,8 @@ class ESession : public LogEvent {
       out << " (" << inos.size() << " inos, v" << inotablev << ")";
   }
   
-  void update_segment();
-  void replay(MDSRank *mds);
+  void update_segment() override;
+  void replay(MDSRank *mds) override;
   entity_inst_t get_client_inst() const {return client_inst;}
 };
 WRITE_CLASS_ENCODER_FEATURES(ESession)
index a9a834c390e8938a63cce453d96502fd18f1dd53..f784d63eb0c10c2a3c5f71f1bc9db5d3a6804bc3 100644 (file)
@@ -38,22 +38,22 @@ public:
 
   void mark_old_encoding() { old_style_encode = true; }
 
-  void encode(bufferlist &bl, uint64_t features) const;
+  void encode(bufferlist &bl, uint64_t features) const override;
   void decode_old(bufferlist::iterator &bl);
   void decode_new(bufferlist::iterator &bl);
-  void decode(bufferlist::iterator &bl) {
+  void decode(bufferlist::iterator &bl) override {
     if (old_style_encode) decode_old(bl);
     else decode_new(bl);
   }
-  void dump(Formatter *f) const;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<ESessions*>& ls);
 
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "ESessions " << client_map.size() << " opens cmapv " << cmapv;
   }
   
-  void update_segment();
-  void replay(MDSRank *mds);  
+  void update_segment() override;
+  void replay(MDSRank *mds) override;  
 };
 WRITE_CLASS_ENCODER_FEATURES(ESessions)
 
index 8147455fc62a68da15cc70fd5cf390728f2fd697..ea1fa3acf772eb04b79509f6b3c89876b16a1fb8 100644 (file)
@@ -126,7 +126,7 @@ public:
     master(mastermds),
     op(o), origop(oo) { }
   
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     if (type.length())
       out << type << " ";
     out << " " << (int)op;
@@ -137,14 +137,14 @@ public:
     out << commit;
   }
 
-  EMetaBlob *get_metablob() { return &commit; }
+  EMetaBlob *get_metablob() override { return &commit; }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator& bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator& bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<ESlaveUpdate*>& ls);
 
-  void replay(MDSRank *mds);
+  void replay(MDSRank *mds) override;
 };
 WRITE_CLASS_ENCODER_FEATURES(ESlaveUpdate)
 
index e021ecc114c8a00a896ed22587a39498aa9da3a6..def22a7916fcb7da76506b9403d84cd2299cf64c 100644 (file)
@@ -28,20 +28,20 @@ public:
 
   ESubtreeMap() : LogEvent(EVENT_SUBTREEMAP), expire_pos(0), event_seq(0) { }
   
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "ESubtreeMap " << subtrees.size() << " subtrees " 
        << ", " << ambiguous_subtrees.size() << " ambiguous "
        << metablob;
   }
 
-  EMetaBlob *get_metablob() { return &metablob; }
+  EMetaBlob *get_metablob() override { return &metablob; }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator& bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator& bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<ESubtreeMap*>& ls);
 
-  void replay(MDSRank *mds);
+  void replay(MDSRank *mds) override;
 };
 WRITE_CLASS_ENCODER_FEATURES(ESubtreeMap)
 
index 97b220767a5380b9f311b0bdece0c44c622cb392..7633d9e066fad58932361bf6971a4a5fac87a637 100644 (file)
@@ -31,18 +31,18 @@ struct ETableClient : public LogEvent {
     LogEvent(EVENT_TABLECLIENT),
     table(t), op(o), tid(ti) { }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator& bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator& bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<ETableClient*>& ls);
 
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "ETableClient " << get_mdstable_name(table) << " " << get_mdstableserver_opname(op);
     if (tid) out << " tid " << tid;
   }  
 
   //void update_segment();
-  void replay(MDSRank *mds);  
+  void replay(MDSRank *mds) override;  
 };
 WRITE_CLASS_ENCODER_FEATURES(ETableClient)
 
index 196905ad17f6c8946d3462cdc6e5cb519f6f558c..b8dd9dbacfc97271bf3a3929d5d49b0dc401c56f 100644 (file)
@@ -36,12 +36,12 @@ struct ETableServer : public LogEvent {
     LogEvent(EVENT_TABLESERVER),
     table(t), op(o), reqid(ri), bymds(m), tid(ti), version(v) { }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator& bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator& bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<ETableServer*>& ls);
 
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     out << "ETableServer " << get_mdstable_name(table) 
        << " " << get_mdstableserver_opname(op);
     if (reqid) out << " reqid " << reqid;
@@ -51,8 +51,8 @@ struct ETableServer : public LogEvent {
     if (mutation.length()) out << " mutation=" << mutation.length() << " bytes";
   }  
 
-  void update_segment();
-  void replay(MDSRank *mds);  
+  void update_segment() override;
+  void replay(MDSRank *mds) override;  
 };
 WRITE_CLASS_ENCODER_FEATURES(ETableServer)
 
index 7d567e22e7639408a10295512d50f3dfbcb465bd..c4ef5627fd8ac2615c8af4e08db53f9823710ed6 100644 (file)
@@ -32,21 +32,21 @@ public:
     LogEvent(EVENT_UPDATE), metablob(mdlog),
     type(s), cmapv(0), had_slaves(false) { }
   
-  void print(ostream& out) const {
+  void print(ostream& out) const override {
     if (type.length())
       out << "EUpdate " << type << " ";
     out << metablob;
   }
 
-  EMetaBlob *get_metablob() { return &metablob; }
+  EMetaBlob *get_metablob() override { return &metablob; }
 
-  void encode(bufferlist& bl, uint64_t features) const;
-  void decode(bufferlist::iterator& bl);
-  void dump(Formatter *f) const;
+  void encode(bufferlist& bl, uint64_t features) const override;
+  void decode(bufferlist::iterator& bl) override;
+  void dump(Formatter *f) const override;
   static void generate_test_instances(list<EUpdate*>& ls);
 
-  void update_segment();
-  void replay(MDSRank *mds);
+  void update_segment() override;
+  void replay(MDSRank *mds) override;
   EMetaBlob const *get_metablob() const {return &metablob;}
 };
 WRITE_CLASS_ENCODER_FEATURES(EUpdate)