]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/lba_manager/btree: replumb to pass op_context_t
authorSamuel Just <sjust@redhat.com>
Tue, 14 Jul 2020 05:13:39 +0000 (22:13 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 16 Jul 2020 23:16:42 +0000 (16:16 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc
src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.h
src/crimson/os/seastore/lba_manager/btree/lba_btree_node.h
src/crimson/os/seastore/lba_manager/btree/lba_btree_node_impl.cc
src/crimson/os/seastore/lba_manager/btree/lba_btree_node_impl.h

index a578f9aca2fd09b04e85176be312338b577cb115..3449b40b71990b6a2a1b5c4512d7d804a9102b91 100644 (file)
@@ -47,8 +47,7 @@ BtreeLBAManager::get_root(Transaction &t)
       paddr_t{croot->get_lba_root().lba_root_addr},
       unsigned(croot->get_lba_root().lba_depth));
     return get_lba_btree_extent(
-      cache,
-      t,
+      get_context(t),
       croot->get_lba_root().lba_depth,
       croot->get_lba_root().lba_root_addr,
       paddr_t());
@@ -64,7 +63,8 @@ BtreeLBAManager::get_mapping(
   return get_root(
     t).safe_then([this, &t, offset, length](auto extent) {
       return extent->lookup_range(
-       cache, t, offset, length);
+       get_context(t),
+       offset, length);
     }).safe_then([](auto &&e) {
       logger().debug("BtreeLBAManager::get_mapping: got mapping {}", e);
       return get_mapping_ret(
@@ -110,8 +110,7 @@ BtreeLBAManager::alloc_extent(
        "BtreeLBAManager::alloc_extent: beginning search at {}",
        *extent);
       return extent->find_hole(
-       cache,
-       t,
+       get_context(t),
        hint,
        L_ADDR_MAX,
        len).safe_then([extent](auto ret) {
@@ -199,11 +198,15 @@ BtreeLBAManager::insert_mapping_ret BtreeLBAManager::insert_mapping(
          nullptr);
        croot->get_lba_root().lba_root_addr = nroot->get_paddr();
        croot->get_lba_root().lba_depth = root->depth + 1;
-       return nroot->split_entry(cache, t, laddr, nroot->begin(), root);
+       return nroot->split_entry(
+         get_context(t),
+         laddr, nroot->begin(), root);
       });
   }
   return split.safe_then([this, &t, laddr, val](LBANodeRef node) {
-    return node->insert(cache, t, laddr, val);
+    return node->insert(
+      get_context(t),
+      laddr, val);
   });
 }
 
@@ -240,8 +243,7 @@ BtreeLBAManager::update_mapping_ret BtreeLBAManager::update_mapping(
   return get_root(t
   ).safe_then([this, f=std::move(f), &t, addr](LBANodeRef root) mutable {
     return root->mutate_mapping(
-      cache,
-      t,
+      get_context(t),
       addr,
       std::move(f));
   });
index 6d9543e1976cd90851b99c82a26a2b4f8bc485fa..cdd3af7c40195734951b2b66b4df8536754be2e7 100644 (file)
@@ -92,6 +92,10 @@ private:
   SegmentManager &segment_manager;
   Cache &cache;
 
+  op_context_t get_context(Transaction &t) {
+    return op_context_t{cache, t};
+  }
+
   /**
    * get_root
    *
index e4e180930f8b0fdc546e44cdfad1c484924301a8..f1a1b93eec4fc0722efbace683878c67ab77e200 100644 (file)
 
 namespace crimson::os::seastore::lba_manager::btree {
 
+struct op_context_t {
+  Cache &cache;
+  Transaction &trans;
+};
+
 /**
  * lba_map_val_t
  *
@@ -58,8 +63,7 @@ struct LBANode : CachedExtent {
    * Returns mappings within range [addr, addr+len)
    */
   virtual lookup_range_ret lookup_range(
-    Cache &cache,
-    Transaction &transaction,
+    op_context_t c,
     laddr_t addr,
     extent_len_t len) = 0;
 
@@ -76,8 +80,7 @@ struct LBANode : CachedExtent {
     >;
   using insert_ret = insert_ertr::future<LBAPinRef>;
   virtual insert_ret insert(
-    Cache &cache,
-    Transaction &transaction,
+    op_context_t c,
     laddr_t laddr,
     lba_map_val_t val) = 0;
 
@@ -92,8 +95,7 @@ struct LBANode : CachedExtent {
     crimson::ct_error::input_output_error>;
   using find_hole_ret = find_hole_ertr::future<laddr_t>;
   virtual find_hole_ret find_hole(
-    Cache &cache,
-    Transaction &t,
+    op_context_t c,
     laddr_t min,
     laddr_t max,
     extent_len_t len) = 0;
@@ -117,8 +119,7 @@ struct LBANode : CachedExtent {
     std::optional<lba_map_val_t>(const lba_map_val_t &v)
     >;
   virtual mutate_mapping_ret mutate_mapping(
-    Cache &cache,
-    Transaction &transaction,
+    op_context_t c,
     laddr_t laddr,
     mutate_func_t &&f) = 0;
 
@@ -134,7 +135,8 @@ struct LBANode : CachedExtent {
     LBANodeRef,
     LBANodeRef,
     laddr_t>
-  make_split_children(Cache &cache, Transaction &t) = 0;
+  make_split_children(
+    op_context_t c) = 0;
 
   /**
    * make_full_merge
@@ -143,7 +145,8 @@ struct LBANode : CachedExtent {
    * Precondition: at_min_capacity() && right.at_min_capacity()
    */
   virtual LBANodeRef make_full_merge(
-    Cache &cache, Transaction &t, LBANodeRef &right) = 0;
+    op_context_t c,
+    LBANodeRef &right) = 0;
 
   /**
    * make_balanced
@@ -157,7 +160,8 @@ struct LBANode : CachedExtent {
     LBANodeRef,
     laddr_t>
   make_balanced(
-    Cache &cache, Transaction &t, LBANodeRef &right,
+    op_context_t c,
+    LBANodeRef &right,
     bool prefer_left) = 0;
 
   virtual bool at_max_capacity() const = 0;
@@ -173,8 +177,7 @@ using LBANodeRef = LBANode::LBANodeRef;
  * Fetches node at depth of the appropriate type.
  */
 Cache::get_extent_ertr::future<LBANodeRef> get_lba_btree_extent(
-  Cache &cache,
-  Transaction &t,
+  op_context_t c, ///< [in] context structure
   depth_t depth,  ///< [in] depth of node to fetch
   paddr_t offset, ///< [in] physical addr of node
   paddr_t base    ///< [in] depending on user, block addr or record addr
index 8ae640e2cdc5723f3efda479495c6bc5573f08ef..bb6a3dec3a12b3ff903cf44033373be3e30f6c40 100644 (file)
@@ -27,8 +27,7 @@ std::ostream &LBAInternalNode::print_detail(std::ostream &out) const
 }
 
 LBAInternalNode::lookup_range_ret LBAInternalNode::lookup_range(
-  Cache &cache,
-  Transaction &t,
+  op_context_t c,
   laddr_t addr,
   extent_len_t len)
 {
@@ -38,18 +37,16 @@ LBAInternalNode::lookup_range_ret LBAInternalNode::lookup_range(
   return crimson::do_for_each(
     std::move(begin),
     std::move(end),
-    [this, &cache, &t, &result, addr, len](const auto &val) mutable {
+    [this, c, &result, addr, len](const auto &val) mutable {
       return get_lba_btree_extent(
-       cache,
-       t,
+       c,
        depth-1,
        val.get_val(),
        get_paddr()).safe_then(
-         [&cache, &t, &result, addr, len](auto extent) mutable {
+         [c, &result, addr, len](auto extent) mutable {
            // TODO: add backrefs to ensure cache residence of parents
            return extent->lookup_range(
-             cache,
-             t,
+             c,
              addr,
              len).safe_then(
                [&result](auto pin_list) mutable {
@@ -64,46 +61,41 @@ LBAInternalNode::lookup_range_ret LBAInternalNode::lookup_range(
 }
 
 LBAInternalNode::insert_ret LBAInternalNode::insert(
-  Cache &cache,
-  Transaction &t,
+  op_context_t c,
   laddr_t laddr,
   lba_map_val_t val)
 {
   auto insertion_pt = get_containing_child(laddr);
   return get_lba_btree_extent(
-    cache,
-    t,
+    c,
     depth-1,
     insertion_pt->get_val(),
     get_paddr()).safe_then(
-      [this, insertion_pt, &cache, &t, laddr, val=std::move(val)](
+      [this, insertion_pt, c, laddr, val=std::move(val)](
        auto extent) mutable {
        return extent->at_max_capacity() ?
-         split_entry(cache, t, laddr, insertion_pt, extent) :
+         split_entry(c, laddr, insertion_pt, extent) :
          insert_ertr::make_ready_future<LBANodeRef>(std::move(extent));
-      }).safe_then([&cache, &t, laddr, val=std::move(val)](
+      }).safe_then([c, laddr, val=std::move(val)](
                     LBANodeRef extent) mutable {
-       return extent->insert(cache, t, laddr, val);
+       return extent->insert(c, laddr, val);
       });
 }
 
 LBAInternalNode::mutate_mapping_ret LBAInternalNode::mutate_mapping(
-  Cache &cache,
-  Transaction &t,
+  op_context_t c,
   laddr_t laddr,
   mutate_func_t &&f)
 {
   return get_lba_btree_extent(
-    cache,
-    t,
+    c,
     depth-1,
     get_containing_child(laddr)->get_val(),
     get_paddr()
-  ).safe_then([this, &cache, &t, laddr](LBANodeRef extent) {
+  ).safe_then([this, c, laddr](LBANodeRef extent) {
     if (extent->at_min_capacity()) {
       return merge_entry(
-       cache,
-       t,
+       c,
        laddr,
        get_containing_child(laddr),
        extent);
@@ -111,14 +103,13 @@ LBAInternalNode::mutate_mapping_ret LBAInternalNode::mutate_mapping(
       return merge_ertr::make_ready_future<LBANodeRef>(
        std::move(extent));
     }
-  }).safe_then([&cache, &t, laddr, f=std::move(f)](LBANodeRef extent) mutable {
-    return extent->mutate_mapping(cache, t, laddr, std::move(f));
+  }).safe_then([c, laddr, f=std::move(f)](LBANodeRef extent) mutable {
+    return extent->mutate_mapping(c, laddr, std::move(f));
   });
 }
 
 LBAInternalNode::find_hole_ret LBAInternalNode::find_hole(
-  Cache &cache,
-  Transaction &t,
+  op_context_t c,
   laddr_t min,
   laddr_t max,
   extent_len_t len)
@@ -131,28 +122,26 @@ LBAInternalNode::find_hole_ret LBAInternalNode::find_hole(
     bounds.first,
     bounds.second,
     L_ADDR_NULL,
-    [this, &cache, &t, len](auto &i, auto &e, auto &ret) {
+    [this, c, len](auto &i, auto &e, auto &ret) {
       return crimson::do_until(
-       [this, &cache, &t, &i, &e, &ret, len] {
+       [this, c, &i, &e, &ret, len] {
          if (i == e) {
            return find_hole_ertr::make_ready_future<std::optional<laddr_t>>(
              std::make_optional<laddr_t>(L_ADDR_NULL));
          }
          return get_lba_btree_extent(
-           cache,
-           t,
+           c,
            depth-1,
            i->get_val(),
            get_paddr()
-         ).safe_then([&cache, &t, &i, len](auto extent) mutable {
+         ).safe_then([c, &i, len](auto extent) mutable {
            logger().debug(
              "LBAInternalNode::find_hole extent {} lb {} ub {}",
              *extent,
              i->get_key(),
              i->get_next_key_or_max());
            return extent->find_hole(
-             cache,
-             t,
+             c,
              i->get_key(),
              i->get_next_key_or_max(),
              len);
@@ -188,17 +177,19 @@ void LBAInternalNode::resolve_relative_addrs(paddr_t base) {
 
 LBAInternalNode::split_ret
 LBAInternalNode::split_entry(
-  Cache &c, Transaction &t, laddr_t addr,
+  op_context_t c,
+  laddr_t addr,
   internal_iterator_t iter, LBANodeRef entry)
 {
   if (!is_pending()) {
-    auto mut = c.duplicate_for_write(t, this)->cast<LBAInternalNode>();
+    auto mut = c.cache.duplicate_for_write(
+      c.trans, this)->cast<LBAInternalNode>();
     auto mut_iter = mut->iter_idx(iter->get_offset());
-    return mut->split_entry(c, t, addr, mut_iter, entry);
+    return mut->split_entry(c, addr, mut_iter, entry);
   }
 
   ceph_assert(!at_max_capacity());
-  auto [left, right, pivot] = entry->make_split_children(c, t);
+  auto [left, right, pivot] = entry->make_split_children(c);
 
   journal_update(
     iter,
@@ -210,7 +201,7 @@ LBAInternalNode::split_entry(
     maybe_generate_relative(right->get_paddr()),
     maybe_get_delta_buffer());
 
-  c.retire_extent(t, entry);
+  c.cache.retire_extent(c.trans, entry);
 
   logger().debug(
     "LBAInternalNode::split_entry *this {} left {} right {}",
@@ -225,13 +216,14 @@ LBAInternalNode::split_entry(
 
 LBAInternalNode::merge_ret
 LBAInternalNode::merge_entry(
-  Cache &c, Transaction &t, laddr_t addr,
+  op_context_t c,
+  laddr_t addr,
   internal_iterator_t iter, LBANodeRef entry)
 {
   if (!is_pending()) {
-    auto mut = c.duplicate_for_write(t, this)->cast<LBAInternalNode>();
+    auto mut = c.cache.duplicate_for_write(c.trans, this)->cast<LBAInternalNode>();
     auto mut_iter = mut->iter_idx(iter->get_offset());
-    return mut->merge_entry(c, t, addr, mut_iter, entry);
+    return mut->merge_entry(c, addr, mut_iter, entry);
   }
 
   logger().debug(
@@ -242,11 +234,10 @@ LBAInternalNode::merge_entry(
   auto donor_iter = donor_is_left ? iter - 1 : iter + 1;
   return get_lba_btree_extent(
     c,
-    t,
     depth - 1,
     donor_iter->get_val(),
     get_paddr()
-  ).safe_then([this, &c, &t, addr, iter, entry, donor_iter, donor_is_left](
+  ).safe_then([this, c, addr, iter, entry, donor_iter, donor_is_left](
                auto donor) mutable {
     auto [l, r] = donor_is_left ?
       std::make_pair(donor, entry) : std::make_pair(entry, donor);
@@ -255,7 +246,6 @@ LBAInternalNode::merge_entry(
     if (donor->at_min_capacity()) {
       auto replacement = l->make_full_merge(
        c,
-       t,
        r);
 
       journal_update(
@@ -264,8 +254,8 @@ LBAInternalNode::merge_entry(
        maybe_get_delta_buffer());
       journal_remove(riter, maybe_get_delta_buffer());
 
-      c.retire_extent(t, l);
-      c.retire_extent(t, r);
+      c.cache.retire_extent(c.trans, l);
+      c.cache.retire_extent(c.trans, r);
       return split_ertr::make_ready_future<LBANodeRef>(replacement);
     } else {
       logger().debug(
@@ -275,7 +265,6 @@ LBAInternalNode::merge_entry(
       auto [replacement_l, replacement_r, pivot] =
        l->make_balanced(
          c,
-         t,
          r,
          !donor_is_left);
 
@@ -289,8 +278,8 @@ LBAInternalNode::merge_entry(
        maybe_generate_relative(replacement_r->get_paddr()),
        maybe_get_delta_buffer());
 
-      c.retire_extent(t, l);
-      c.retire_extent(t, r);
+      c.cache.retire_extent(c.trans, l);
+      c.cache.retire_extent(c.trans, r);
       return split_ertr::make_ready_future<LBANodeRef>(
        addr >= pivot ? replacement_r : replacement_l
       );
@@ -318,8 +307,7 @@ std::ostream &LBALeafNode::print_detail(std::ostream &out) const
 }
 
 LBALeafNode::lookup_range_ret LBALeafNode::lookup_range(
-  Cache &cache,
-  Transaction &t,
+  op_context_t c,
   laddr_t addr,
   extent_len_t len)
 {
@@ -342,19 +330,15 @@ LBALeafNode::lookup_range_ret LBALeafNode::lookup_range(
 }
 
 LBALeafNode::insert_ret LBALeafNode::insert(
-  Cache &cache,
-  Transaction &t,
+  op_context_t c,
   laddr_t laddr,
   lba_map_val_t val)
 {
   ceph_assert(!at_max_capacity());
 
   if (!is_pending()) {
-    return cache.duplicate_for_write(t, this)->cast<LBALeafNode>()->insert(
-      cache,
-      t,
-      laddr,
-      val);
+    return c.cache.duplicate_for_write(c.trans, this
+    )->cast<LBALeafNode>()->insert(c, laddr, val);
   }
 
   val.paddr = maybe_generate_relative(val.paddr);
@@ -381,16 +365,14 @@ LBALeafNode::insert_ret LBALeafNode::insert(
 }
 
 LBALeafNode::mutate_mapping_ret LBALeafNode::mutate_mapping(
-  Cache &cache,
-  Transaction &transaction,
+  op_context_t c,
   laddr_t laddr,
   mutate_func_t &&f)
 {
   if (!is_pending()) {
-    return cache.duplicate_for_write(transaction, this)->cast<LBALeafNode>(
+    return c.cache.duplicate_for_write(c.trans, this)->cast<LBALeafNode>(
     )->mutate_mapping(
-      cache,
-      transaction,
+      c,
       laddr,
       std::move(f));
   }
@@ -419,8 +401,7 @@ LBALeafNode::mutate_mapping_ret LBALeafNode::mutate_mapping(
 }
 
 LBALeafNode::find_hole_ret LBALeafNode::find_hole(
-  Cache &cache,
-  Transaction &t,
+  op_context_t c,
   laddr_t min,
   laddr_t max,
   extent_len_t len)
@@ -470,8 +451,7 @@ LBALeafNode::get_leaf_entries(laddr_t addr, extent_len_t len)
 }
 
 Cache::get_extent_ertr::future<LBANodeRef> get_lba_btree_extent(
-  Cache &cache,
-  Transaction &t,
+  op_context_t c,
   depth_t depth,
   paddr_t offset,
   paddr_t base) {
@@ -481,8 +461,8 @@ Cache::get_extent_ertr::future<LBANodeRef> get_lba_btree_extent(
       "get_lba_btree_extent: reading internal at offset {}, depth {}",
       offset,
       depth);
-    return cache.get_extent<LBAInternalNode>(
-      t,
+    return c.cache.get_extent<LBAInternalNode>(
+      c.trans,
       offset,
       LBA_BLOCK_SIZE).safe_then([depth](auto ret) {
        ret->set_depth(depth);
@@ -494,8 +474,8 @@ Cache::get_extent_ertr::future<LBANodeRef> get_lba_btree_extent(
       "get_lba_btree_extent: reading leaf at offset {}, depth {}",
       offset,
       depth);
-    return cache.get_extent<LBALeafNode>(
-      t,
+    return c.cache.get_extent<LBALeafNode>(
+      c.trans,
       offset,
       LBA_BLOCK_SIZE).safe_then([offset, depth](auto ret) {
        logger().debug(
index 5cbbdddca881dc0fa6b3c30b5328c471351c7730..716ce458eeeb5531d4afbe307f0f00711774d8a3 100644 (file)
@@ -63,36 +63,32 @@ struct LBAInternalNode
   }
 
   lookup_range_ret lookup_range(
-    Cache &cache,
-    Transaction &transaction,
+    op_context_t c,
     laddr_t addr,
     extent_len_t len) final;
 
   insert_ret insert(
-    Cache &cache,
-    Transaction &transaction,
+    op_context_t c,
     laddr_t laddr,
     lba_map_val_t val) final;
 
   mutate_mapping_ret mutate_mapping(
-    Cache &cache,
-    Transaction &transaction,
+    op_context_t c,
     laddr_t laddr,
     mutate_func_t &&f) final;
 
   find_hole_ret find_hole(
-    Cache &cache,
-    Transaction &t,
+    op_context_t c,
     laddr_t min,
     laddr_t max,
     extent_len_t len) final;
 
   std::tuple<LBANodeRef, LBANodeRef, laddr_t>
-  make_split_children(Cache &cache, Transaction &t) final {
-    auto left = cache.alloc_new_extent<LBAInternalNode>(
-      t, LBA_BLOCK_SIZE);
-    auto right = cache.alloc_new_extent<LBAInternalNode>(
-      t, LBA_BLOCK_SIZE);
+  make_split_children(op_context_t c) final {
+    auto left = c.cache.alloc_new_extent<LBAInternalNode>(
+      c.trans, LBA_BLOCK_SIZE);
+    auto right = c.cache.alloc_new_extent<LBAInternalNode>(
+      c.trans, LBA_BLOCK_SIZE);
     return std::make_tuple(
       left,
       right,
@@ -100,24 +96,25 @@ struct LBAInternalNode
   }
 
   LBANodeRef make_full_merge(
-    Cache &cache, Transaction &t, LBANodeRef &right) final {
-    auto replacement = cache.alloc_new_extent<LBAInternalNode>(
-      t, LBA_BLOCK_SIZE);
+    op_context_t c,
+    LBANodeRef &right) final {
+    auto replacement = c.cache.alloc_new_extent<LBAInternalNode>(
+      c.trans, LBA_BLOCK_SIZE);
     replacement->merge_from(*this, *right->cast<LBAInternalNode>());
     return replacement;
   }
 
   std::tuple<LBANodeRef, LBANodeRef, laddr_t>
   make_balanced(
-    Cache &cache, Transaction &t,
+    op_context_t c,
     LBANodeRef &_right,
     bool prefer_left) final {
     ceph_assert(_right->get_type() == type);
     auto &right = *_right->cast<LBAInternalNode>();
-    auto replacement_left = cache.alloc_new_extent<LBAInternalNode>(
-      t, LBA_BLOCK_SIZE);
-    auto replacement_right = cache.alloc_new_extent<LBAInternalNode>(
-      t, LBA_BLOCK_SIZE);
+    auto replacement_left = c.cache.alloc_new_extent<LBAInternalNode>(
+      c.trans, LBA_BLOCK_SIZE);
+    auto replacement_right = c.cache.alloc_new_extent<LBAInternalNode>(
+      c.trans, LBA_BLOCK_SIZE);
 
     return std::make_tuple(
       replacement_left,
@@ -215,7 +212,8 @@ struct LBAInternalNode
     >;
   using split_ret = split_ertr::future<LBANodeRef>;
   split_ret split_entry(
-    Cache &c, Transaction &t, laddr_t addr,
+    op_context_t c,
+    laddr_t addr,
     internal_iterator_t,
     LBANodeRef entry);
 
@@ -224,7 +222,8 @@ struct LBAInternalNode
     >;
   using merge_ret = merge_ertr::future<LBANodeRef>;
   merge_ret merge_entry(
-    Cache &c, Transaction &t, laddr_t addr,
+    op_context_t c,
+    laddr_t addr,
     internal_iterator_t,
     LBANodeRef entry);
 
@@ -297,36 +296,32 @@ struct LBALeafNode
   }
 
   lookup_range_ret lookup_range(
-    Cache &cache,
-    Transaction &transaction,
+    op_context_t c,
     laddr_t addr,
     extent_len_t len) final;
 
   insert_ret insert(
-    Cache &cache,
-    Transaction &transaction,
+    op_context_t c,
     laddr_t laddr,
     lba_map_val_t val) final;
 
   mutate_mapping_ret mutate_mapping(
-    Cache &cache,
-    Transaction &transaction,
+    op_context_t c,
     laddr_t laddr,
     mutate_func_t &&f) final;
 
   find_hole_ret find_hole(
-    Cache &cache,
-    Transaction &t,
+    op_context_t c,
     laddr_t min,
     laddr_t max,
     extent_len_t len) final;
 
   std::tuple<LBANodeRef, LBANodeRef, laddr_t>
-  make_split_children(Cache &cache, Transaction &t) final {
-    auto left = cache.alloc_new_extent<LBALeafNode>(
-      t, LBA_BLOCK_SIZE);
-    auto right = cache.alloc_new_extent<LBALeafNode>(
-      t, LBA_BLOCK_SIZE);
+  make_split_children(op_context_t c) final {
+    auto left = c.cache.alloc_new_extent<LBALeafNode>(
+      c.trans, LBA_BLOCK_SIZE);
+    auto right = c.cache.alloc_new_extent<LBALeafNode>(
+      c.trans, LBA_BLOCK_SIZE);
     return std::make_tuple(
       left,
       right,
@@ -334,24 +329,25 @@ struct LBALeafNode
   }
 
   LBANodeRef make_full_merge(
-    Cache &cache, Transaction &t, LBANodeRef &right) final {
-    auto replacement = cache.alloc_new_extent<LBALeafNode>(
-      t, LBA_BLOCK_SIZE);
+    op_context_t c,
+    LBANodeRef &right) final {
+    auto replacement = c.cache.alloc_new_extent<LBALeafNode>(
+      c.trans, LBA_BLOCK_SIZE);
     replacement->merge_from(*this, *right->cast<LBALeafNode>());
     return replacement;
   }
 
   std::tuple<LBANodeRef, LBANodeRef, laddr_t>
   make_balanced(
-    Cache &cache, Transaction &t,
+    op_context_t c,
     LBANodeRef &_right,
     bool prefer_left) final {
     ceph_assert(_right->get_type() == type);
     auto &right = *_right->cast<LBALeafNode>();
-    auto replacement_left = cache.alloc_new_extent<LBALeafNode>(
-      t, LBA_BLOCK_SIZE);
-    auto replacement_right = cache.alloc_new_extent<LBALeafNode>(
-      t, LBA_BLOCK_SIZE);
+    auto replacement_left = c.cache.alloc_new_extent<LBALeafNode>(
+      c.trans, LBA_BLOCK_SIZE);
+    auto replacement_right = c.cache.alloc_new_extent<LBALeafNode>(
+      c.trans, LBA_BLOCK_SIZE);
     return std::make_tuple(
       replacement_left,
       replacement_right,