void finish_write(TransContext* txc, uint32_t offset, uint32_t length);
struct printer : public BlueStore::printer {
- const Onode& onode;
+ const Onode &onode;
uint16_t mode;
- printer(const Onode& onode, uint16_t mode)
- :onode(onode), mode(mode) {}
+ uint32_t from = 0;
+ uint32_t end = OBJECT_MAX_SIZE;
+ printer(const Onode &onode, uint16_t mode) : onode(onode), mode(mode) {}
+ printer(const Onode &onode, uint16_t mode, uint32_t from, uint32_t end)
+ : onode(onode), mode(mode), from(from), end(end) {}
};
- friend std::ostream& operator<<(std::ostream& out, const printer &p);
- printer print(uint16_t mode) const {
- return printer(*this, mode);
+ friend std::ostream &operator<<(std::ostream &out, const printer &p);
+ printer print(uint16_t mode) const { return printer(*this, mode); }
+ printer print(uint16_t mode, uint32_t from, uint32_t end) const {
+ return printer(*this, mode, from, end);
}
};
<< " expected_write_size " << o.onode.expected_write_size
<< " in " << o.onode.extent_map_shards.size() << " shards"
<< ", " << o.extent_map.spanning_blob_map.size()
- << " spanning blobs" << std::endl;
+ << " spanning blobs";
const BlueStore::ExtentMap& map = o.extent_map;
std::set<BlueStore::Blob*> visited;
- for (const auto& e : map.extent_map) {
- BlueStore::Blob* b = e.blob.get();
+ // to make printing extents in-sync with blobs
+ uint16_t mode_extent = (mode & (P::PTR | P::NICK)) | P::JUSTID;
+ auto i = map.seek_lextent(p.from);
+ while (i != map.extent_map.end() && i->logical_offset < p.end) {
+ BlueStore::Blob* b = i->blob.get();
+ out << std::endl << i->print(mode_extent);
if (!visited.contains(b)) {
- out << b->print(mode) << std::endl;
visited.insert(b);
}
+ ++i;
}
- // to make printing extents in-sync with blobs
- uint16_t mode_extent = (mode & (P::PTR | P::NICK)) | P::JUSTID;
- for (const auto& e : map.extent_map) {
- out << e.print(mode_extent) << std::endl;
+ for (const auto& i : visited) {
+ out << std::endl << i->print(mode);
}
if (mode & P::ATTRS) {
for (const auto& p : o.onode.attrs) {
- out << " attr " << p.first
- << " len " << p.second.length() << std::endl;
+ out << std::endl << "attr " << p.first << " len " << p.second.length();
}
}
return out;