]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 13 Jun 2024 12:25:49 +0000 (15:25 +0300)
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
(cherry picked from commit ac4981160e790368cbb49b469937bee83edd26fb)

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 c8f1858041a01d33f5ac9738eab02fd55fffb989..28d2529d186aaa413128caf17b34b61333b1b399 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 {