]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/linked_tree_node: move "account_absent_access()" out
authorXuehan Xu <xuxuehan@qianxin.com>
Thu, 6 Mar 2025 08:29:54 +0000 (16:29 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Wed, 16 Apr 2025 03:00:15 +0000 (11:00 +0800)
of ExtentTransViewRetriever

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/btree/fixed_kv_btree.h
src/crimson/os/seastore/cache.h
src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc
src/crimson/os/seastore/linked_tree_node.h

index a635407dcadb8c33e4950428c2b2481a4b94fec7..b3270a94b6cd1035cfcf172e7bfbef367bba729a 100644 (file)
@@ -1503,6 +1503,7 @@ private:
         return on_found(child->template cast<internal_node_t>());
       });
     }
+    c.cache.account_absent_access(c.trans.get_src());
 
     auto child_pos = v.get_child_pos();
     auto next_iter = node_iter + 1;
@@ -1574,6 +1575,7 @@ private:
         return on_found(child->template cast<leaf_node_t>());
       });
     }
+    c.cache.account_absent_access(c.trans.get_src());
 
     auto child_pos = v.get_child_pos();
     auto next_iter = node_iter + 1;
@@ -2133,6 +2135,7 @@ private:
         return do_merge(child->template cast<NodeType>());
       });
     }
+    c.cache.account_absent_access(c.trans.get_src());
 
     auto child_pos = v.get_child_pos();
     return get_node<NodeType>(
index 0041d7b6d698835c13ea901473cce6d11fc574ad..8e597cafd1160d0884df080e2767dbd8ada840f6 100644 (file)
@@ -186,7 +186,7 @@ public:
     return t.root;
   }
 
-  void account_absent_access(Transaction::src_t src) final {
+  void account_absent_access(Transaction::src_t src) {
     ++(get_by_src(stats.cache_absent_by_src, src));
     ++stats.access.cache_absent;
   }
index a14e18a56c214f4e2f20d5e033982b3c2461d4e1..5dbbbaf8a9fda85d386b9356383822eac369554a 100644 (file)
@@ -103,6 +103,7 @@ BtreeLBAMapping::get_logical_extent(Transaction &t)
     : get_key();
   auto v = p.template get_child<LogicalChildNode>(ctx.trans, ctx.cache, pos, k);
   if (!v.has_child()) {
+    ctx.cache.account_absent_access(ctx.trans.get_src());
     this->child_pos = v.get_child_pos();
   }
   return v;
index 572b7e1ccfcb51bbae7eaa7eea15e40720b97892..013f401cc4a5fd7d0b8a9fa4a2f09587f5068792 100644 (file)
@@ -250,7 +250,6 @@ public:
       return ext->template cast<T>();
     });
   }
-  virtual void account_absent_access(Transaction::src_t) = 0;
   virtual bool is_viewable_extent_data_stable(Transaction &, CachedExtentRef) = 0;
   virtual bool is_viewable_extent_stable(Transaction &, CachedExtentRef) = 0;
   virtual ~ExtentTransViewRetriever() {}
@@ -350,11 +349,9 @@ public:
        return etvr.get_extent_viewable_by_trans<ChildT>(
          t, static_cast<ChildT*>(child));
       } else {
-        etvr.account_absent_access(t.get_src());
        return child_pos_t<T>(&sparent, spos);
       }
     } else {
-      etvr.account_absent_access(t.get_src());
       return child_pos_t<T>(&me, pos);
     }
   }