#ifdef HAVE_LIBZBD
if (bdev->is_smr()) {
for (auto& i : txc->old_zone_offset_refs) {
- for (auto& j : i.second) {
- dout(20) << __func__ << " rm ref zone 0x" << std::hex << j.first
- << " offset 0x" << j.second << std::dec
- << " -> " << i.first->oid << dendl;
- string key;
- get_zone_offset_object_key(j.first, j.second, i.first->oid, &key);
- txc->t->rmkey(PREFIX_ZONED_CL_INFO, key);
- }
+ dout(20) << __func__ << " rm ref zone 0x" << std::hex << i.first.second
+ << " offset 0x" << i.second << std::dec
+ << " -> " << i.first.first->oid << dendl;
+ string key;
+ get_zone_offset_object_key(i.first.second, i.second, i.first.first->oid, &key);
+ txc->t->rmkey(PREFIX_ZONED_CL_INFO, key);
}
for (auto& i : txc->new_zone_offset_refs) {
- for (auto& j : i.second) {
- // (zone, offset) -> oid
- dout(20) << __func__ << " add ref zone 0x" << std::hex << j.first
- << " offset 0x" << j.second << std::dec
- << " -> " << i.first->oid << dendl;
- string key;
- get_zone_offset_object_key(j.first, j.second, i.first->oid, &key);
- bufferlist v;
- txc->t->set(PREFIX_ZONED_CL_INFO, key, v);
- }
+ // (zone, offset) -> oid
+ dout(20) << __func__ << " add ref zone 0x" << std::hex << i.first.second
+ << " offset 0x" << i.second << std::dec
+ << " -> " << i.first.first->oid << dendl;
+ string key;
+ get_zone_offset_object_key(i.first.second, i.second, i.first.first->oid, &key);
+ bufferlist v;
+ txc->t->set(PREFIX_ZONED_CL_INFO, key, v);
}
}
#endif
// to that zone do not generate additional refs. This is a bit imprecise but
// is sufficient to generate reasonably sequential reads when doing zone
// cleaning with less metadata than a ref for every extent.
- std::map<OnodeRef, std::map<uint32_t, uint64_t>> new_zone_offset_refs;
- std::map<OnodeRef, std::map<uint32_t, uint64_t>> old_zone_offset_refs;
+ std::map<std::pair<OnodeRef, uint32_t>, uint64_t> new_zone_offset_refs;
+ std::map<std::pair<OnodeRef, uint32_t>, uint64_t> old_zone_offset_refs;
#endif
std::set<SharedBlobRef> shared_blobs; ///< these need to be updated/written
#ifdef HAVE_LIBZBD
void note_write_zone_offset(OnodeRef& o, uint32_t zone, uint64_t offset) {
o->onode.zone_offset_refs[zone] = offset;
- new_zone_offset_refs[o][zone] = offset;
+ new_zone_offset_refs[std::make_pair(o, zone)] = offset;
}
void note_release_zone_offset(OnodeRef& o, uint32_t zone, uint64_t offset) {
- old_zone_offset_refs[o][zone] = offset;
+ old_zone_offset_refs[std::make_pair(o, zone)] = offset;
o->onode.zone_offset_refs.erase(zone);
}
#endif