small_encode(extents, bl);
small_encode_varint(flags, bl);
if (is_compressed()) {
+ small_encode_varint_lowz(compressed_length_orig, bl);
small_encode_varint_lowz(compressed_length, bl);
}
if (has_csum()) {
small_decode(extents, p);
small_decode_varint(flags, p);
if (is_compressed()) {
+ small_decode_varint_lowz(compressed_length_orig, p);
small_decode_varint_lowz(compressed_length, p);
} else {
- compressed_length = 0;
+ compressed_length_orig = compressed_length = 0;
}
if (has_csum()) {
small_decode_varint(csum_type, p);
f->dump_object("extent", p);
}
f->close_section();
+ f->dump_unsigned("compressed_length_original", compressed_length_orig);
f->dump_unsigned("compressed_length", compressed_length);
f->dump_unsigned("flags", flags);
f->dump_unsigned("csum_type", csum_type);
ostream& operator<<(ostream& out, const bluestore_blob_t& o)
{
out << "blob(" << o.extents
- << " clen 0x" << std::hex << o.compressed_length << std::dec;
+ << " clen 0x" << std::hex
+ << o.compressed_length_orig
+ << " -> " << std::hex
+ << o.compressed_length
+ << std::dec;
if (o.flags) {
out << " " << o.get_flags_string();
}
}
vector<bluestore_pextent_t> extents;///< raw data position on device
+ uint32_t compressed_length_orig = 0;///< original length of compressed blob if any
uint32_t compressed_length = 0; ///< compressed length if any
uint32_t flags = 0; ///< FLAG_*
return get_flags_string(flags);
}
- void set_compressed(uint64_t clen) {
+ void set_compressed(uint64_t clen_orig, uint64_t clen) {
set_flag(FLAG_COMPRESSED);
+ compressed_length_orig = clen_orig;
compressed_length = clen;
}
bool is_mutable() const {
uint32_t get_compressed_payload_length() const {
return is_compressed() ? compressed_length : 0;
}
+ uint32_t get_compressed_payload_original_length() const {
+ return is_compressed() ? compressed_length_orig : 0;
+ }
uint64_t calc_offset(uint64_t x_off, uint64_t *plen) const {
auto p = extents.begin();
assert(p != extents.end());