1
0
Mirror von https://github.com/tkuschel/bees.git synchronisiert 2026-06-19 06:57:54 +02:00

crucible: use set instead of vector in BtrfsExtentWalker

This gets rid of some more big memsets.  It may replace them
with a lot of tiny mallocs, though.  If this turns out to be
a bad idea then at least we can easily revert the change.
Dieser Commit ist enthalten in:
Zygo Blaxell
2016-12-13 21:34:12 -05:00
Ursprung 7782b79e4b
Commit e835e8766e
2 geänderte Dateien mit 11 neuen und 3 gelöschten Zeilen
+7 -2
Datei anzeigen
@@ -707,6 +707,12 @@ namespace crucible {
return offset + len;
}
bool
BtrfsIoctlSearchHeader::operator<(const BtrfsIoctlSearchHeader &that) const
{
return tie(objectid, type, offset, len, transid) < tie(that.objectid, that.type, that.offset, that.len, that.transid);
}
bool
BtrfsIoctlSearchKey::do_ioctl_nothrow(int fd)
{
@@ -727,13 +733,12 @@ namespace crucible {
static_cast<btrfs_ioctl_search_key&>(*this) = ioctl_ptr->key;
m_result.clear();
m_result.reserve(nr_items);
size_t offset = pointer_distance(ioctl_ptr->buf, ioctl_ptr);
for (decltype(nr_items) i = 0; i < nr_items; ++i) {
BtrfsIoctlSearchHeader item;
offset = item.set_data(ioctl_arg, offset);
m_result.push_back(item);
m_result.insert(item);
}
return true;