]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/SessionMap: add const to member functions 11541/head
authorMichal Jarzabek <stiopa@gmail.com>
Tue, 18 Oct 2016 20:55:14 +0000 (21:55 +0100)
committerMichal Jarzabek <stiopa@gmail.com>
Tue, 18 Oct 2016 20:55:14 +0000 (21:55 +0100)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/mds/SessionMap.cc
src/mds/SessionMap.h

index 9c536e1a020c7a955b464c5461239fb53c45538a..9149a52ab6a6163849ca75a8c4ff8326a2c436f1 100644 (file)
@@ -73,7 +73,7 @@ void SessionMap::dump()
 // LOAD
 
 
-object_t SessionMap::get_object_name()
+object_t SessionMap::get_object_name() const
 {
   char s[30];
   snprintf(s, sizeof(s), "mds%d_sessionmap", int(mds->get_nodeid()));
index ec28e4483bf9e1d6bbdb0d1144fe73fa9ea216e3..de010c348e49c451fbe48070949f1229b73ea90f 100644 (file)
@@ -151,7 +151,7 @@ public:
   void notify_cap_release(size_t n_caps);
   void notify_recall_sent(int const new_limit);
 
-  inodeno_t next_ino() {
+  inodeno_t next_ino() const {
     if (info.prealloc_inos.empty())
       return 0;
     return info.prealloc_inos.range_start();
@@ -172,17 +172,17 @@ public:
     info.used_inos.insert(ino, 1);
     return ino;
   }
-  int get_num_projected_prealloc_inos() {
+  int get_num_projected_prealloc_inos() const {
     return info.prealloc_inos.size() + pending_prealloc_inos.size();
   }
 
-  client_t get_client() {
+  client_t get_client() const {
     return info.get_client();
   }
 
   int get_state() { return state; }
   const char *get_state_name() const { return get_state_name(state); }
-  uint64_t get_state_seq() { return state_seq; }
+  uint64_t get_state_seq() const { return state_seq; }
   bool is_closed() const { return state == STATE_CLOSED; }
   bool is_opening() const { return state == STATE_OPENING; }
   bool is_open() const { return state == STATE_OPEN; }
@@ -197,7 +197,7 @@ public:
     assert(importing_count > 0);
     --importing_count;
   }
-  bool is_importing() { return importing_count > 0; }
+  bool is_importing() const { return importing_count > 0; }
 
   // -- caps --
 private:
@@ -292,12 +292,16 @@ public:
   }
 
   unsigned get_num_completed_flushes() const { return info.completed_flushes.size(); }
-  unsigned get_num_trim_flushes_warnings() { return num_trim_flushes_warnings; }
+  unsigned get_num_trim_flushes_warnings() const {
+    return num_trim_flushes_warnings;
+  }
   void inc_num_trim_flushes_warnings() { ++num_trim_flushes_warnings; }
   void reset_num_trim_flushes_warnings() { num_trim_flushes_warnings = 0; }
 
   unsigned get_num_completed_requests() const { return info.completed_requests.size(); }
-  unsigned get_num_trim_requests_warnings() { return num_trim_requests_warnings; }
+  unsigned get_num_trim_requests_warnings() const {
+    return num_trim_requests_warnings;
+  }
   void inc_num_trim_requests_warnings() { ++num_trim_requests_warnings; }
   void reset_num_trim_requests_warnings() { num_trim_requests_warnings = 0; }
 
@@ -590,7 +594,7 @@ public:
   inodeno_t ino;
   list<MDSInternalContextBase*> waiting_for_load;
 
-  object_t get_object_name();
+  object_t get_object_name() const;
 
   void load(MDSInternalContextBase *onload);
   void _load_finish(