]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: initailize log_root if set_all_hint is called with the correspon...
authorMyoungwon Oh <ohmyoungwon@gmail.com>
Wed, 15 Jan 2025 08:19:28 +0000 (08:19 +0000)
committermyoungwon oh <ohmyoungwon@gmail.com>
Thu, 20 Feb 2025 12:27:41 +0000 (12:27 +0000)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/crimson/os/seastore/seastore.cc

index cd9536b9568a6ec94d484b7ea97d1170fe8d07e1..b4b1b92f8ed053caabc281621957494810f977dd 100644 (file)
@@ -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: