]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: drop the unnecessary friend fixed_kv_btree
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 7 Mar 2024 05:42:51 +0000 (13:42 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 7 May 2024 11:27:07 +0000 (14:27 +0300)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
(cherry picked from commit 0558ef8b1a16060c0cd424635315db25f5c68351)

src/crimson/os/seastore/btree/fixed_kv_btree.h
src/crimson/os/seastore/cache.h

index b91a4e2d07bf911adc7e3f0c7fb8750ec41c77d3..2d758ef4be2d8d355542c0719ff8f61a460c967c 100644 (file)
@@ -579,12 +579,12 @@ public:
           if constexpr (
             std::is_base_of_v<typename internal_node_t::base_t, child_node_t>)
           {
-            assert(!c.cache.query_cache(i->get_val(), nullptr));
+            assert(!c.cache.test_query_cache(i->get_val()));
           } else {
             if constexpr (leaf_has_children) {
               assert(i->get_val().pladdr.is_paddr()
-                ? (bool)!c.cache.query_cache(
-                    i->get_val().pladdr.get_paddr(), nullptr)
+                ? (bool)!c.cache.test_query_cache(
+                    i->get_val().pladdr.get_paddr())
                 : true);
             }
           }
index 75463f465fe14c7d68b38701906d8851ab76973e..5093c79b81c1f1a7a37df1df420a7bedcd50d54d 100644 (file)
@@ -600,6 +600,12 @@ public:
     return epm.get_block_size();
   }
 
+// Interfaces only for tests.
+public:
+  CachedExtentRef test_query_cache(paddr_t offset) {
+    return query_cache(offset, nullptr);
+  }
+
 private:
   // This is a workaround std::move_only_function not being available,
   // not really worth generalizing at this time.
@@ -1732,16 +1738,6 @@ private:
       return CachedExtentRef();
     }
   }
-
-  template <
-    typename node_key_t,
-    typename node_val_t,
-    typename internal_node_t,
-    typename leaf_node_t,
-    typename pin_t,
-    size_t node_size,
-    bool leaf_has_children>
-  friend class FixedKVBtree;
 };
 using CacheRef = std::unique_ptr<Cache>;