From be26aaa7944c8795e8249b3025fb3a4d49818e2a Mon Sep 17 00:00:00 2001 From: Michal Jarzabek Date: Mon, 7 Nov 2016 22:49:49 +0000 Subject: [PATCH] mds/Migrator.h: add const to member functions Signed-off-by: Michal Jarzabek --- src/mds/Migrator.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/mds/Migrator.h b/src/mds/Migrator.h index d991ef873242e..2d14bd95ceb62 100644 --- a/src/mds/Migrator.h +++ b/src/mds/Migrator.h @@ -155,21 +155,21 @@ public: void show_exporting(); // -- status -- - int is_exporting(CDir *dir) { - map::iterator it = export_state.find(dir); + int is_exporting(CDir *dir) const { + map::const_iterator it = export_state.find(dir); if (it != export_state.end()) return it->second.state; return 0; } - bool is_exporting() { return !export_state.empty(); } - int is_importing(dirfrag_t df) { - map::iterator it = import_state.find(df); + bool is_exporting() const { return !export_state.empty(); } + int is_importing(dirfrag_t df) const { + map::const_iterator it = import_state.find(df); if (it != import_state.end()) return it->second.state; return 0; } - bool is_importing() { return !import_state.empty(); } + bool is_importing() const { return !import_state.empty(); } - bool is_ambiguous_import(dirfrag_t df) { - map::iterator p = import_state.find(df); + bool is_ambiguous_import(dirfrag_t df) const { + map::const_iterator p = import_state.find(df); if (p == import_state.end()) return false; if (p->second.state >= IMPORT_LOGGINGSTART && @@ -178,19 +178,19 @@ public: return false; } - int get_import_state(dirfrag_t df) { - map::iterator it = import_state.find(df); + int get_import_state(dirfrag_t df) const { + map::const_iterator it = import_state.find(df); assert(it != import_state.end()); return it->second.state; } - int get_import_peer(dirfrag_t df) { - map::iterator it = import_state.find(df); + int get_import_peer(dirfrag_t df) const { + map::const_iterator it = import_state.find(df); assert(it != import_state.end()); return it->second.peer; } - int get_export_state(CDir *dir) { - map::iterator it = export_state.find(dir); + int get_export_state(CDir *dir) const { + map::const_iterator it = export_state.find(dir); assert(it != export_state.end()); return it->second.state; } @@ -205,8 +205,8 @@ public: return (it->second.warning_ack_waiting.count(who) == 0); } - bool export_has_notified(CDir *dir, mds_rank_t who) { - map::iterator it = export_state.find(dir); + bool export_has_notified(CDir *dir, mds_rank_t who) const { + map::const_iterator it = export_state.find(dir); assert(it != export_state.end()); assert(it->second.state == EXPORT_NOTIFYING); return (it->second.notify_ack_waiting.count(who) == 0); -- 2.39.5