<< dendl;
}
std::lock_guard l(e.blob->shared_blob->get_cache()->lock);
- for (auto& i : e.blob->bc.buffer_map) {
+ for (auto& i : e.blob->get_bc().buffer_map) {
dout(LogLevelV) << __func__ << " 0x" << std::hex << i.first
<< "~" << i.second->length << std::dec
<< " " << *i.second << dendl;
ceph_assert(discard == all_invalid); // in case of compressed blob all
// or none pextents are invalid.
if (discard) {
- bc.discard(shared_blob->get_cache(), 0,
+ dirty_bc().discard(shared_blob->get_cache(), 0,
get_blob().get_logical_length());
}
} else {
dout(20) << __func__ << " 0x" << std::hex << pos
<< "~" << e.length
<< std::dec << dendl;
- bc.discard(shared_blob->get_cache(), pos, e.length);
+ dirty_bc().discard(shared_blob->get_cache(), pos, e.length);
}
pos += e.length;
}
&(r->used_in_blob));
lb.split(blob_offset, rb);
- bc.split(shared_blob->get_cache(), blob_offset, r->bc);
+ dirty_bc().split(shared_blob->get_cache(), blob_offset, r->dirty_bc());
dout(10) << __func__ << " 0x" << std::hex << blob_offset << std::dec
<< " finish " << *this << dendl;
ready_regions_t cache_res;
interval_set<uint32_t> cache_interval;
- bptr->bc.read(
+ bptr->dirty_bc().read(
bptr->shared_blob->get_cache(), b_off, b_len, cache_res, cache_interval,
read_cache_policy);
dout(20) << __func__ << " blob " << *bptr << std::hex
if (r < 0)
return r;
if (buffered) {
- bptr->bc.did_read(bptr->shared_blob->get_cache(), 0,
+ bptr->dirty_bc().did_read(bptr->shared_blob->get_cache(), 0,
raw_bl);
}
for (auto& req : r2r) {
return -EIO;
}
if (buffered) {
- bptr->bc.did_read(bptr->shared_blob->get_cache(),
+ bptr->dirty_bc().did_read(bptr->shared_blob->get_cache(),
req.r_off, req.bl);
}
bool can_split() const {
std::lock_guard l(shared_blob->get_cache()->lock);
// splitting a BufferSpace writing list is too hard; don't try.
- return bc.writing.empty() &&
+ return get_bc().writing.empty() &&
used_in_blob.can_split() &&
get_blob().can_split();
}
return blob;
}
+ inline const BufferSpace& get_bc() const {
+ return bc;
+ }
+ inline BufferSpace& dirty_bc() {
+ return bc;
+ }
+
/// discard buffers for unallocated regions
void discard_unallocated(Collection *coll);
uint64_t offset,
ceph::buffer::list& bl,
unsigned flags) {
- b->bc.write(b->shared_blob->get_cache(), txc->seq, offset, bl,
+ b->dirty_bc().write(b->shared_blob->get_cache(), txc->seq, offset, bl,
flags);
txc->blobs_written.insert(b);
}