}
if (wi.mark_unused) {
+ ceph_assert(!dblob.is_compressed());
auto b_end = b_off + wi.bl.length();
if (b_off) {
dblob.add_unused(0, b_off);
}
- if (b_end < wi.blob_length) {
- dblob.add_unused(b_end, wi.blob_length - b_end);
+ uint64_t llen = dblob.get_logical_length();
+ if (b_end < llen) {
+ dblob.add_unused(b_end, llen - b_end);
}
}
if (!has_unused()) {
return false;
}
+ ceph_assert(!is_compressed());
uint64_t blob_len = get_logical_length();
ceph_assert((blob_len % (sizeof(unused)*8)) == 0);
ceph_assert(offset + length <= blob_len);
/// mark a range that has never been used
void add_unused(uint64_t offset, uint64_t length) {
+ ceph_assert(!is_compressed());
uint64_t blob_len = get_logical_length();
ceph_assert((blob_len % (sizeof(unused)*8)) == 0);
ceph_assert(offset + length <= blob_len);
/// indicate that a range has (now) been used.
void mark_used(uint64_t offset, uint64_t length) {
if (has_unused()) {
+ ceph_assert(!is_compressed());
uint64_t blob_len = get_logical_length();
ceph_assert((blob_len % (sizeof(unused)*8)) == 0);
ceph_assert(offset + length <= blob_len);