more constness, and better performance.
Signed-off-by: Kefu Chai <kchai@redhat.com>
{
bool first = true;
out << '[';
- for (auto &i: rhs) {
+ for (const auto &i: rhs) {
out << (first ? "" : ",") << *i;
first = false;
}
BtreeOMapManager::handle_root_split(
omap_context_t oc,
omap_root_t &omap_root,
- OMapNode::mutation_result_t mresult)
+ const OMapNode::mutation_result_t& mresult)
{
return oc.tm.alloc_extent<OMapInnerNode>(oc.t, L_ADDR_MIN, OMAP_BLOCK_SIZE)
.safe_then([&omap_root, mresult](auto&& nroot) -> handle_root_split_ret {
*/
using get_root_ertr = base_ertr;
using get_root_ret = get_root_ertr::future<OMapNodeRef>;
- get_root_ret get_omap_root(
+ static get_root_ret get_omap_root(
omap_context_t c,
const omap_root_t &omap_root);
handle_root_split_ret handle_root_split(
omap_context_t c,
omap_root_t &omap_root,
- OMapNode::mutation_result_t mresult);
+ const OMapNode::mutation_result_t& mresult);
/* handle_root_merge
*
{
}
-BlockSegmentManager::mount_ret BlockSegmentManager::mount(mount_config_t config)
+BlockSegmentManager::mount_ret BlockSegmentManager::mount(const mount_config_t& config)
{
return open_device(
config.path, seastar::open_flags::rw | seastar::open_flags::dsync
};
using mount_ertr = access_ertr;
using mount_ret = access_ertr::future<>;
- mount_ret mount(mount_config_t);
+ mount_ret mount(const mount_config_t&);
struct mkfs_config_t {
std::string path;