From: Michal Jarzabek Date: Sat, 11 Jun 2016 16:34:05 +0000 (+0100) Subject: osdc/ObjectCacher: add const to member functions X-Git-Tag: v11.0.1~166^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ab8786571e1ecb493e3ba4d57f7ecbe623620b82;p=ceph.git osdc/ObjectCacher: add const to member functions Signed-off-by: Michal Jarzabek --- diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 4a53e26ccdf9..f9cb1adddfc2 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -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::const_iterator p = data_lower_bound(cur); diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index 7b5a7a4fbdc8..d233f0c57183 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -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& hits,