first_free_idx = omap_idx;
}
auto& ctl = omap_updates.at(omap_idx);
-
+ if (ctl.write_size >= max_write_size) {
+ journal_func(omap_idx);
+ ctl.write_size = 0;
+ }
if (p != anchor_map.end()) {
bufferlist bl;
encode(p->second, bl);
ctl.write_size += len + sizeof(__u32);
ctl.to_remove.emplace(key);
}
-
- if (ctl.write_size >= max_write_size) {
- journal_func(omap_idx);
- ctl.write_size = 0;
- }
}
dirty_items.clear();
--count;
auto& ctl = omap_updates.at(omap_idx);
- ctl.write_size += len + sizeof(__u32);
- ctl.to_remove.emplace(key);
-
if (ctl.write_size >= max_write_size) {
- journal_func(omap_idx);
- ctl.write_size = 0;
+ journal_func(omap_idx);
+ ctl.write_size = 0;
}
+ ctl.write_size += len + sizeof(__u32);
+ ctl.to_remove.emplace(key);
}
loaded_anchor_map.clear();
}
bool first = true;
for (auto& it : ctl.journaled_update) {
- ctl.write_size += it.first.length() + it.second.length() + 2 * sizeof(__u32);
- ctl.to_update[it.first].swap(it.second);
if (ctl.write_size >= max_write_size) {
- create_op_func(omap_idx, first);
- ctl.write_size = 0;
- first = false;
+ create_op_func(omap_idx, first);
+ ctl.write_size = 0;
+ first = false;
}
+ ctl.write_size += it.first.length() + it.second.length() + 2 * sizeof(__u32);
+ ctl.to_update[it.first].swap(it.second);
total_updates++;
}
for (auto& key : ctl.journaled_remove) {
- ctl.write_size += key.length() + sizeof(__u32);
- ctl.to_remove.emplace(key);
if (ctl.write_size >= max_write_size) {
- create_op_func(omap_idx, first);
- ctl.write_size = 0;
- first = false;
+ create_op_func(omap_idx, first);
+ ctl.write_size = 0;
+ first = false;
}
+
+ ctl.write_size += key.length() + sizeof(__u32);
+ ctl.to_remove.emplace(key);
total_removes++;
}