mirror of
https://github.com/ceph/ceph
synced 2025-02-21 18:17:42 +00:00
osdc/ObjectCacher: take Object ref when there are buffers
Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
a34a8b8bae
commit
57e18a74fe
@ -251,12 +251,16 @@ class ObjectCacher {
|
||||
// bh
|
||||
// add to my map
|
||||
void add_bh(BufferHead *bh) {
|
||||
if (data.empty())
|
||||
get();
|
||||
assert(data.count(bh->start()) == 0);
|
||||
data[bh->start()] = bh;
|
||||
}
|
||||
void remove_bh(BufferHead *bh) {
|
||||
assert(data.count(bh->start()));
|
||||
data.erase(bh->start());
|
||||
if (data.empty())
|
||||
put();
|
||||
}
|
||||
|
||||
bool is_empty() { return data.empty(); }
|
||||
|
Loading…
Reference in New Issue
Block a user