{
return out << std::hex << "0x" << e.logical_offset << "~" << e.length
<< ": 0x" << e.blob_offset << "~" << e.length << std::dec
+ << " depth " << (int)e.blob_depth
<< " " << *e.blob;
}
}
}
-bool BlueStore::_blobs_need_garbage_collection(
+bool BlueStore::_do_write_check_depth(
OnodeRef o,
uint64_t start_offset,
uint64_t end_offset,
*blob_depth = 1;
auto hp = o->extent_map.seek_lextent(start_offset);
-
- if (hp != o->extent_map.extent_map.end() && hp->logical_offset < start_offset &&
+ if (hp != o->extent_map.extent_map.end() &&
+ hp->logical_offset < start_offset &&
start_offset < hp->logical_offset + hp->length) {
depth = hp->blob_depth;
head_overlap = true;
}
auto tp = o->extent_map.seek_lextent(end_offset);
-
- if (tp != o->extent_map.extent_map.end() && tp->logical_offset < end_offset &&
+ if (tp != o->extent_map.extent_map.end() &&
+ tp->logical_offset < end_offset &&
end_offset < tp->logical_offset + tp->length) {
tail_overlap = true;
if (depth < tp->blob_depth) {
*gc_end_offset = tp->logical_offset + tp_prev->length;
}
}
+ dout(20) << __func__ << " depth " << (int)depth
+ << ", gc 0x" << std::hex << *gc_start_offset << "~"
+ << (*gc_end_offset - *gc_start_offset)
+ << std::dec << dendl;
if (depth >= g_conf->bluestore_gc_max_blob_depth) {
return true;
} else {
<< std::dec << dendl;
uint64_t gc_start_offset = offset, gc_end_offset = end;
-
- if (_blobs_need_garbage_collection(o, offset, end, &wctx.blob_depth,
- &gc_start_offset, &gc_end_offset) == true) {
+ if (_do_write_check_depth(o, offset, end, &wctx.blob_depth,
+ &gc_start_offset, &gc_end_offset)) {
// we need garbage collection of blobs.
if (offset > gc_start_offset) {
bufferlist head_bl;
void _pad_zeros(bufferlist *bl, uint64_t *offset,
uint64_t chunk_size);
- bool _blobs_need_garbage_collection(OnodeRef o,
- uint64_t start_offset,
- uint64_t end_offset,
- uint8_t *blob_depth,
- uint64_t *gc_start_offset,
- uint64_t *gc_end_offset);
+ bool _do_write_check_depth(
+ OnodeRef o,
+ uint64_t start_offset,
+ uint64_t end_offset,
+ uint8_t *blob_depth,
+ uint64_t *gc_start_offset,
+ uint64_t *gc_end_offset);
int _do_write(TransContext *txc,
CollectionRef &c,