]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/ObjectCacher: add const to member functions 9644/head
authorMichal Jarzabek <stiopa@gmail.com>
Sat, 11 Jun 2016 16:34:05 +0000 (17:34 +0100)
committerMichal Jarzabek <stiopa@gmail.com>
Sat, 11 Jun 2016 17:05:54 +0000 (18:05 +0100)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/osdc/ObjectCacher.cc
src/osdc/ObjectCacher.h

index 4a53e26ccdf9a8af1b719e3217795e917d6d54e1..f9cb1adddfc261d595982f6278dedba04bec20ed 100644 (file)
@@ -168,7 +168,7 @@ void ObjectCacher::Object::try_merge_bh(BufferHead *bh)
 /*
  * count bytes we have cached in given range
  */
-bool ObjectCacher::Object::is_cached(loff_t cur, loff_t left)
+bool ObjectCacher::Object::is_cached(loff_t cur, loff_t left) const
 {
   assert(oc->lock.is_locked());
   map<loff_t, BufferHead*>::const_iterator p = data_lower_bound(cur);
index 7b5a7a4fbdc887d9d4586ec07200f0ebc241835d..d233f0c571839114bcad3a1c72f1df29568b8592 100644 (file)
@@ -332,14 +332,14 @@ class ObjectCacher {
        put();
     }
 
-    bool is_empty() { return data.empty(); }
+    bool is_empty() const { return data.empty(); }
 
     // mid-level
     BufferHead *split(BufferHead *bh, loff_t off);
     void merge_left(BufferHead *left, BufferHead *right);
     void try_merge_bh(BufferHead *bh);
 
-    bool is_cached(loff_t off, loff_t len);
+    bool is_cached(loff_t off, loff_t len) const;
     bool include_all_cached_data(loff_t off, loff_t len);
     int map_read(ObjectExtent &ex,
                  map<loff_t, BufferHead*>& hits,