]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/segment_cleaner: add more method comments
authorSamuel Just <sjust@redhat.com>
Wed, 24 Mar 2021 05:40:39 +0000 (22:40 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 24 Mar 2021 05:41:11 +0000 (22:41 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/segment_cleaner.h

index 5ef9e8d4505fed01f96c6ca6ed460dc84995baf2..5fd7fb080abd7b3496bbdf9d73527cd874066efc 100644 (file)
@@ -341,8 +341,13 @@ private:
   int64_t used_bytes = 0;
   bool init_complete = false;
 
+  /// target journal_tail for next fresh segment
   journal_seq_t journal_tail_target;
+
+  /// most recently committed journal_tail
   journal_seq_t journal_tail_committed;
+
+  /// head of journal
   journal_seq_t journal_head;
 
   ExtentCallbackInterface *ecb = nullptr;
@@ -653,16 +658,19 @@ private:
     return scan_cursor->get_offset().offset;
   }
 
+  /// Returns free space available for writes
   size_t get_available_bytes() const {
     return (empty_segments * config.segment_size) +
       get_bytes_available_current_segment() +
       get_bytes_scanned_current_segment();
   }
 
+  /// Returns total space available
   size_t get_total_bytes() const {
     return config.segment_size * config.num_segments;
   }
 
+  /// Returns total space not free
   size_t get_unavailable_bytes() const {
     return get_total_bytes() - get_available_bytes();
   }
@@ -696,7 +704,8 @@ private:
   /**
    * get_reclaim_ratio
    *
-   * Returns the ratio of unavailable space that is not currently used.
+   * Returns the ratio of space reclaimable unavailable space to
+   * total unavailable space.
    */
   double get_reclaim_ratio() const {
     if (get_unavailable_bytes() == 0) return 0;