// enough regions together.
dout(20) << __func__ << " " << *blob << " " << *extent << dendl;
IOContext ioc(NULL); // FIXME?
- uint64_t chunk_size = MAX(blob->get_csum_block_size(), block_size);
+ uint64_t chunk_size = MAX(blob->get_csum_chunk_size(), block_size);
// all physical extents has to be aligned with read chunk size
assert((extent->length % chunk_size) == 0);
<< " bstart 0x" << std::hex << bstart << std::dec << dendl;
// can we pad our head/tail out with zeros?
- uint64_t chunk_size = MAX(block_size, b->get_csum_block_size());
+ uint64_t chunk_size = MAX(block_size, b->get_csum_chunk_size());
uint64_t head_pad = offset % chunk_size;
if (head_pad && o->onode.has_any_lextents(offset - head_pad, chunk_size)) {
head_pad = 0;
::encode(compressed_length, bl);
::encode(flags, bl);
::encode(csum_type, bl);
- ::encode(csum_block_order, bl);
+ ::encode(csum_chunk_order, bl);
::encode(ref_map, bl);
::encode(unused, bl);
::encode(csum_data, bl);
::decode(compressed_length, p);
::decode(flags, p);
::decode(csum_type, p);
- ::decode(csum_block_order, p);
+ ::decode(csum_chunk_order, p);
::decode(ref_map, p);
::decode(unused, p);
::decode(csum_data, p);
f->dump_unsigned("compressed_length", compressed_length);
f->dump_unsigned("flags", flags);
f->dump_unsigned("csum_type", csum_type);
- f->dump_unsigned("csum_block_order", csum_block_order);
+ f->dump_unsigned("csum_chunk_order", csum_chunk_order);
f->dump_object("ref_map", ref_map);
f->open_array_section("csum_data");
size_t n = get_csum_count();
ls.push_back(new bluestore_blob_t(4096, bluestore_pextent_t(111, 222), 12));
ls.push_back(new bluestore_blob_t(4096, bluestore_pextent_t(111, 222), 12));
ls.back()->csum_type = CSUM_XXHASH32;
- ls.back()->csum_block_order = 16;
+ ls.back()->csum_chunk_order = 16;
ls.back()->csum_data = buffer::claim_malloc(4, strdup("abcd"));
ls.back()->ref_map.get(3, 5);
ls.back()->add_unused(0, 3);
}
if (o.csum_type) {
out << " " << o.get_csum_type_string(o.csum_type)
- << "/0x" << std::hex << (1ull << o.csum_block_order) << std::dec;
+ << "/0x" << std::hex << (1ull << o.csum_chunk_order) << std::dec;
}
if (!o.ref_map.empty()) {
out << " " << o.ref_map;
}
// we cannot release something smaller than our csum chunk size
- if (has_csum_data() && get_csum_block_size() > min_release_size) {
- min_release_size = get_csum_block_size();
+ if (has_csum_data() && get_csum_chunk_size() > min_release_size) {
+ min_release_size = get_csum_chunk_size();
}
// search from logical releases
switch (csum_type) {
case CSUM_XXHASH32:
Checksummer::calculate<Checksummer::xxhash32>(
- get_csum_block_size(), b_off, bl.length(), bl, &csum_data);
+ get_csum_chunk_size(), b_off, bl.length(), bl, &csum_data);
break;
case CSUM_XXHASH64:
Checksummer::calculate<Checksummer::xxhash64>(
- get_csum_block_size(), b_off, bl.length(), bl, &csum_data);
+ get_csum_chunk_size(), b_off, bl.length(), bl, &csum_data);
break;;
case CSUM_CRC32C:
Checksummer::calculate<Checksummer::crc32c>(
- get_csum_block_size(), b_off, bl.length(), bl, &csum_data);
+ get_csum_chunk_size(), b_off, bl.length(), bl, &csum_data);
break;
}
}
break;
case CSUM_XXHASH32:
*b_bad_off = Checksummer::verify<Checksummer::xxhash32>(
- get_csum_block_size(), b_off, bl.length(), bl, csum_data);
+ get_csum_chunk_size(), b_off, bl.length(), bl, csum_data);
break;
case CSUM_XXHASH64:
*b_bad_off = Checksummer::verify<Checksummer::xxhash64>(
- get_csum_block_size(), b_off, bl.length(), bl, csum_data);
+ get_csum_chunk_size(), b_off, bl.length(), bl, csum_data);
break;
case CSUM_CRC32C:
*b_bad_off = Checksummer::verify<Checksummer::crc32c>(
- get_csum_block_size(), b_off, bl.length(), bl, csum_data);
+ get_csum_chunk_size(), b_off, bl.length(), bl, csum_data);
break;
default:
r = -EOPNOTSUPP;
uint32_t flags; ///< FLAG_*
uint8_t csum_type; ///< CSUM_*
- uint8_t csum_block_order; ///< csum block size is 1<<block_order bytes
+ uint8_t csum_chunk_order; ///< csum block size is 1<<block_order bytes
bluestore_extent_ref_map_t ref_map; ///< references (empty when in onode)
interval_set<uint32_t> unused; ///< portion that has never been written to
compressed_length(0),
flags(f),
csum_type(CSUM_NONE),
- csum_block_order(12) {
+ csum_chunk_order(12) {
}
bluestore_blob_t(uint32_t l, const bluestore_pextent_t& ext, uint32_t f = 0)
compressed_length(0),
flags(f),
csum_type(CSUM_NONE),
- csum_block_order(12) {
+ csum_chunk_order(12) {
extents.push_back(ext);
}
uint32_t pl = get_payload_length();
pl = ROUND_UP_TO(pl, block_size);
if(csum_type != CSUM_NONE) {
- pl = ROUND_UP_TO(pl, get_csum_block_size());
+ pl = ROUND_UP_TO(pl, get_csum_chunk_size());
}
return pl;
}
return csum_data.length() > 0;
}
- uint32_t get_csum_block_size() const {
- return 1 << csum_block_order;
+ uint32_t get_csum_chunk_size() const {
+ return 1 << csum_chunk_order;
}
size_t get_csum_value_size() const {
void init_csum(unsigned type, unsigned order, unsigned len) {
csum_type = type;
- csum_block_order = order;
- csum_data = buffer::create(get_csum_value_size() * len / get_csum_block_size());
+ csum_chunk_order = order;
+ csum_data = buffer::create(get_csum_value_size() * len / get_csum_chunk_size());
csum_data.zero();
}