]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/async_cleaner: Introduce get_segments_info
authorMatan Breizman <mbreizma@redhat.com>
Mon, 22 Sep 2025 11:50:09 +0000 (11:50 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Mon, 29 Sep 2025 11:16:39 +0000 (11:16 +0000)
Allow getting the current segments information maintained
by the SegmentCleaner.
Use raw pointer instead of a reference in order to wrap it
in an std::optional.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/os/seastore/async_cleaner.h
src/crimson/os/seastore/extent_placement_manager.h

index 8d08054bc5a3e576b7a35f864915ca3e2f62eedb..3af963951cc265051014a1d61a8efad90aa59076 100644 (file)
@@ -1183,6 +1183,8 @@ public:
 
   virtual void set_extent_callback(ExtentCallbackInterface *) = 0;
 
+  virtual const segments_info_t* get_segments_info() const = 0;
+
   virtual store_statfs_t get_stat() const = 0;
 
   virtual void print(std::ostream &, bool is_detailed) const = 0;
@@ -1350,6 +1352,10 @@ public:
     extent_callback = cb;
   }
 
+  const segments_info_t* get_segments_info() const final {
+   return &segments;
+  }
+
   store_statfs_t get_stat() const final {
     store_statfs_t st;
     st.total = segments.get_total_bytes();
@@ -1712,6 +1718,10 @@ public:
     extent_callback = cb;
   }
 
+  const segments_info_t* get_segments_info() const final {
+   return nullptr;
+  }
+
   store_statfs_t get_stat() const final {
     store_statfs_t st;
     st.total = get_total_bytes();
index f578fd5c7a9a95ea969608c55899c8c543706777..e603ccf9d436841927d53747711192010cdaf5c3 100644 (file)
@@ -727,6 +727,10 @@ private:
       return trimmer->get_backend_type();
     }
 
+    const segments_info_t* get_segments_info() const {
+      return main_cleaner->get_segments_info();
+    }
+
     bool has_cold_tier() const {
       return cold_cleaner.get() != nullptr;
     }