]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: add comments to highlight necessary invariants
authorXuehan Xu <xuxuehan@qianxin.com>
Thu, 16 May 2024 06:56:20 +0000 (14:56 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Fri, 17 May 2024 02:41:22 +0000 (10:41 +0800)
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/btree/fixed_kv_btree.h
src/crimson/os/seastore/transaction_manager.h

index b0901213716bf3152b7fbd02919f5d973fa1e7b4..9a8dd52c361e56f7738b4e06282753e7a65af91a 100644 (file)
@@ -1515,6 +1515,8 @@ private:
     };
 
     auto v = parent->template get_child<internal_node_t>(c, node_iter);
+    // checking the lba child must be atomic with creating
+    // and linking the absent child
     if (v.has_child()) {
       return v.get_child_fut().safe_then(
         [on_found=std::move(on_found), node_iter, c,
@@ -1583,6 +1585,8 @@ private:
     };
 
     auto v = parent->template get_child<leaf_node_t>(c, node_iter);
+    // checking the lba child must be atomic with creating
+    // and linking the absent child
     if (v.has_child()) {
       return v.get_child_fut().safe_then(
         [on_found=std::move(on_found), node_iter, c,
@@ -2136,6 +2140,8 @@ private:
     };
 
     auto v = parent_pos.node->template get_child<NodeType>(c, donor_iter);
+    // checking the lba child must be atomic with creating
+    // and linking the absent child
     if (v.has_child()) {
       return v.get_child_fut().safe_then(
         [do_merge=std::move(do_merge), &pos,
index a6ee603866b81487b6e410bd73456b72a507577d..66574cc4225c9b3de089f440f50f4bc7b8c4f30b 100644 (file)
@@ -176,6 +176,8 @@ public:
     Transaction &t,
     LBAMappingRef pin)
   {
+    // checking the lba child must be atomic with creating
+    // and linking the absent child
     auto ret = get_extent_if_linked<T>(t, std::move(pin));
     if (ret.index() == 1) {
       return std::move(std::get<1>(ret));
@@ -214,6 +216,8 @@ public:
     extent_types_t type)
   {
     auto v = pin->get_logical_extent(t);
+    // checking the lba child must be atomic with creating
+    // and linking the absent child
     if (v.has_child()) {
       return std::move(v.get_child_fut());
     } else {