diff options
Diffstat (limited to 'src/common/shared_cache.hpp')
-rw-r--r-- | src/common/shared_cache.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/shared_cache.hpp b/src/common/shared_cache.hpp index ecb3abe0174..8b48272ee41 100644 --- a/src/common/shared_cache.hpp +++ b/src/common/shared_cache.hpp @@ -24,6 +24,7 @@ template <class K, class V> class SharedLRU { + CephContext *cct; typedef ceph::shared_ptr<V> VPtr; typedef ceph::weak_ptr<V> WeakVPtr; Mutex lock; @@ -84,8 +85,8 @@ class SharedLRU { }; public: - SharedLRU(size_t max_size = 20) - : lock("SharedLRU::lock"), max_size(max_size), size(0) {} + SharedLRU(CephContext *cct = NULL, size_t max_size = 20) + : cct(cct), lock("SharedLRU::lock"), max_size(max_size), size(0) {} ~SharedLRU() { contents.clear(); @@ -93,6 +94,10 @@ public: assert(weak_refs.empty()); } + void set_cct(CephContext *c) { + cct = c; + } + void clear(const K& key) { VPtr val; // release any ref we have after we drop the lock { |