]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/onode-staged-tree: fix get_pivot_index() for leaf node
authorYingxin Cheng <yingxin.cheng@intel.com>
Sun, 11 Apr 2021 15:22:37 +0000 (23:22 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 29 Apr 2021 08:03:37 +0000 (16:03 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/onode_manager/staged-fltree/node_layout.h

index 5533c70812e562325630883d2f811939729614c9..2c82a5cffe76a32d1a8d40091c53d89bd7f7c1e7 100644 (file)
@@ -108,14 +108,13 @@ class NodeLayoutT final : public InternalNodeImpl, public LeafNodeImpl {
   node_offset_t free_size() const override { return extent.read().free_size(); }
 
   std::optional<key_view_t> get_pivot_index() const override {
-    if constexpr (NODE_TYPE == node_type_t::INTERNAL) {
-      if (is_level_tail()) {
-        return std::nullopt;
-      }
+    if (is_level_tail()) {
+      return std::nullopt;
     }
     assert(!is_keys_empty());
     key_view_t pivot_index;
-    get_largest_slot(nullptr, &pivot_index, nullptr);
+    STAGE_T::template get_largest_slot<false, true, false>(
+        extent.read(), nullptr, &pivot_index, nullptr);
     return {pivot_index};
   }