From: Myoungwon Oh Date: Wed, 15 Jan 2025 08:19:28 +0000 (+0000) Subject: crimson/os/seastore: initailize log_root if set_all_hint is called with the correspon... X-Git-Tag: v20.0.0~24^2~13 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=cd6bdd288d68673ab53e4b168b3def0b1a1af973;p=ceph.git crimson/os/seastore: initailize log_root if set_all_hint is called with the corresponding flag Signed-off-by: Myoungwon Oh --- diff --git a/src/crimson/os/seastore/seastore.cc b/src/crimson/os/seastore/seastore.cc index cd9536b9568a6..b4b1b92f8ed05 100644 --- a/src/crimson/os/seastore/seastore.cc +++ b/src/crimson/os/seastore/seastore.cc @@ -1942,6 +1942,22 @@ SeaStore::Shard::_do_transaction_step( DEBUGT("op SETALLOCHINT, oid={}, not implemented", *ctx.transaction, oid); // TODO + if (op->hint & CEPH_OSD_ALLOC_HINT_FLAG_LOG) { + OnodeRef &onode = onodes[op->oid]; + const auto &log_root = onode->get_layout().log_root.get( + onode->get_metadata_hint(device->get_block_size())); + const auto &omap_root = onode->get_layout().omap_root.get( + onode->get_metadata_hint(device->get_block_size())); + ceph_assert(log_root.is_null() && omap_root.is_null()); + return BtreeOMapManager(*transaction_manager).initialize_omap( + *ctx.transaction, onode->get_metadata_hint(device->get_block_size()), + log_root.get_type() + ).si_then([&onode, &ctx](auto new_root) { + if (new_root.must_update()) { + onode->update_log_root(*ctx.transaction, new_root); + } + }); + } return tm_iertr::now(); } case Transaction::OP_CLONE: