MDSCacheObject::get_pin_totals() is debug code of debug code, which
is not quite useful.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
#endif
return ref;
}
-#ifdef MDS_REF_SET
- int get_pin_totals() {
- int total = 0;
- for(std::map<int,int>::iterator i = ref_map.begin(); i != ref_map.end(); ++i) {
- total += i->second;
- }
- return total;
- }
-#endif
virtual const char *pin_name(int by) const = 0;
//bool is_pinned_by(int by) { return ref_set.count(by); }
//multiset<int>& get_ref_set() { return ref_set; }
ref--;
#ifdef MDS_REF_SET
ref_map[by]--;
- assert(ref == get_pin_totals());
#endif
if (ref == 0)
last_put();
if (ref_map.find(by) == ref_map.end())
ref_map[by] = 0;
ref_map[by]++;
- assert(ref == get_pin_totals());
#endif
}