auto start = extent_map.lower_bound(dummy);
uint32_t end = offset + length;
+ __u8 struct_v = 1;
+
unsigned n = 0;
size_t bound = 0;
+ denc(struct_v, bound);
denc_varint(0, bound);
for (auto p = start;
p != extent_map.end() && p->logical_offset < end;
denc_varint(0, bound); // logical_offset
denc_varint(0, bound); // len
denc_varint(0, bound); // blob_offset
- p->blob->bound_encode(bound, false);
+ p->blob->bound_encode(bound, struct_v, false);
}
{
auto app = bl.get_contiguous_appender(bound);
+ denc(struct_v, app);
denc_varint(n, app);
if (pn) {
*pn = n;
}
pos = p->logical_end();
if (include_blob) {
- p->blob->encode(app, false);
+ p->blob->encode(app, struct_v, false);
}
}
}
assert(bl.get_num_buffers() <= 1);
auto p = bl.front().begin_deep();
+ __u8 struct_v;
+ denc(struct_v, p);
+ assert(struct_v == 1);
uint32_t num;
denc_varint(num, p);
vector<BlobRef> blobs(num);
assert(le->blob);
} else {
Blob *b = new Blob();
- b->decode(p, false);
+ b->decode(p, struct_v, false);
blobs[n] = b;
onode->c->open_shared_blob(b);
le->assign_blob(b);
void BlueStore::ExtentMap::bound_encode_spanning_blobs(size_t& p)
{
+ __u8 struct_v = 1;
+ denc(struct_v, p);
denc_varint((uint32_t)0, p);
size_t key_size = 0;
denc_varint((uint32_t)0, key_size);
p += spanning_blob_map.size() * key_size;
for (const auto& i : spanning_blob_map) {
- i.second->bound_encode(p, true);
+ i.second->bound_encode(p, struct_v, true);
}
}
void BlueStore::ExtentMap::encode_spanning_blobs(
bufferlist::contiguous_appender& p)
{
+ __u8 struct_v = 1;
+ denc(struct_v, p);
denc_varint(spanning_blob_map.size(), p);
for (auto& i : spanning_blob_map) {
denc_varint(i.second->id, p);
- i.second->encode(p, true);
+ i.second->encode(p, struct_v, true);
}
}
Collection *c,
bufferptr::iterator& p)
{
+ __u8 struct_v;
+ denc(struct_v, p);
+ assert(struct_v == 1);
unsigned n;
denc_varint(n, p);
while (n--) {
BlobRef b(new Blob());
denc_varint(b->id, p);
spanning_blob_map[b->id] = b;
- b->decode(p, true);
+ b->decode(p, struct_v, true);
c->open_shared_blob(b);
}
}
}
}
#else
- void bound_encode(size_t& p, bool include_ref_map) const {
- denc(blob, p);
+ void bound_encode(size_t& p, uint64_t struct_v, bool include_ref_map) const {
+ denc(blob, p, struct_v);
if (include_ref_map) {
ref_map.bound_encode(p);
}
}
- void encode(bufferlist::contiguous_appender& p, bool include_ref_map) const {
- denc(blob, p);
+ void encode(bufferlist::contiguous_appender& p, uint64_t struct_v,
+ bool include_ref_map) const {
+ denc(blob, p, struct_v);
if (include_ref_map) {
ref_map.encode(p);
}
}
- void decode(bufferptr::iterator& p, bool include_ref_map) {
- denc(blob, p);
+ void decode(bufferptr::iterator& p, uint64_t struct_v,
+ bool include_ref_map) {
+ denc(blob, p, struct_v);
if (include_ref_map) {
ref_map.decode(p);
}
bluestore_blob_t(uint32_t f = 0) : flags(f) {}
DENC_HELPERS;
- void bound_encode(size_t& p) const {
- p += 1;
+ void bound_encode(size_t& p, uint64_t struct_v) const {
+ assert(struct_v == 1);
denc(extents, p);
denc_varint(flags, p);
denc_varint(sbid, p);
p += sizeof(unsigned long long);
}
- void encode(bufferlist::contiguous_appender& p) const {
- __u8 struct_v = 1;
- denc(struct_v, p);
+ void encode(bufferlist::contiguous_appender& p, uint64_t struct_v) const {
+ assert(struct_v == 1);
denc(extents, p);
denc_varint(flags, p);
if (is_shared()) {
}
}
- void decode(bufferptr::iterator& p) {
- __u8 struct_v;
- denc(struct_v, p);
+ void decode(bufferptr::iterator& p, uint64_t struct_v) {
assert(struct_v == 1);
denc(extents, p);
denc_varint(flags, p);
}
}
};
-WRITE_CLASS_DENC(bluestore_blob_t)
+WRITE_CLASS_DENC_FEATURED(bluestore_blob_t)
ostream& operator<<(ostream& out, const bluestore_blob_t& o);