File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
src/crimson/os/seastore/lba Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -436,9 +436,13 @@ BtreeLBAManager::insert_mappings(
436436 ceph_assert (p.second );
437437 iter = std::move (p.first );
438438 auto &leaf_node = *iter.get_leaf_node ();
439+ bool need_reserved_ptr =
440+ info.is_indirect_mapping () || info.is_zero_mapping ();
439441 leaf_node.insert_child_ptr (
440442 iter.get_leaf_pos (),
441- info.extent ,
443+ need_reserved_ptr
444+ ? get_reserved_ptr<LBALeafNode, laddr_t >()
445+ : static_cast <BaseChildNode<LBALeafNode, laddr_t >*>(info.extent ),
442446 leaf_node.get_size () - 1 /* the size before the insert*/ );
443447 if (is_valid_child_ptr (info.extent )) {
444448 ceph_assert (info.value .pladdr .is_paddr ());
Original file line number Diff line number Diff line change @@ -286,6 +286,14 @@ class BtreeLBAManager : public LBAManager {
286286 lba_map_val_t value;
287287 LogicalChildNode* extent = nullptr ;
288288
289+ bool is_zero_mapping () const {
290+ return value.pladdr .is_paddr () && value.pladdr .get_paddr ().is_zero ();
291+ }
292+
293+ bool is_indirect_mapping () const {
294+ return value.pladdr .is_laddr ();
295+ }
296+
289297 static alloc_mapping_info_t create_zero (extent_len_t len) {
290298 return {
291299 L_ADDR_NULL,
@@ -294,8 +302,7 @@ class BtreeLBAManager : public LBAManager {
294302 pladdr_t (P_ADDR_ZERO),
295303 EXTENT_DEFAULT_REF_COUNT,
296304 0
297- },
298- static_cast <LogicalChildNode*>(get_reserved_ptr<LBALeafNode, laddr_t >())};
305+ }};
299306 }
300307 static alloc_mapping_info_t create_indirect (
301308 laddr_t laddr,
@@ -309,8 +316,7 @@ class BtreeLBAManager : public LBAManager {
309316 EXTENT_DEFAULT_REF_COUNT,
310317 0 // crc will only be used and checked with LBA direct mappings
311318 // also see pin_to_extent(_by_type)
312- },
313- static_cast <LogicalChildNode*>(get_reserved_ptr<LBALeafNode, laddr_t >())};
319+ }};
314320 }
315321 static alloc_mapping_info_t create_direct (
316322 laddr_t laddr,
You can’t perform that action at this time.
0 commit comments