From ab8786571e1ecb493e3ba4d57f7ecbe623620b82 Mon Sep 17 00:00:00 2001 From: Michal Jarzabek Date: Sat, 11 Jun 2016 17:34:05 +0100 Subject: [PATCH] osdc/ObjectCacher: add const to member functions Signed-off-by: Michal Jarzabek --- src/osdc/ObjectCacher.cc | 2 +- src/osdc/ObjectCacher.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 4a53e26ccdf9a..f9cb1adddfc26 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 7b5a7a4fbdc88..d233f0c571839 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, -- 2.39.5