]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: swap dirty_from users to get_dirty_from()
authorSamuel Just <sjust@redhat.com>
Thu, 15 Apr 2021 08:56:36 +0000 (08:56 +0000)
committerSamuel Just <sjust@redhat.com>
Tue, 20 Apr 2021 06:51:18 +0000 (23:51 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cache.h

index 4745b7d14f1592e56ce0056524d1d4d5a1e66ee9..ed5c065631ea8b4bb129fe2b7ba4dfe743792a7e 100644 (file)
@@ -114,7 +114,7 @@ void Cache::replace_extent(CachedExtentRef next, CachedExtentRef prev)
     intrusive_ptr_release(&*prev);
     add_to_dirty(next);
   } else if (prev->is_dirty()) {
-    assert(prev->dirty_from == next->dirty_from);
+    assert(prev->get_dirty_from() == next->get_dirty_from());
     assert(prev->primary_ref_list_hook.is_linked());
     auto prev_it = dirty.iterator_to(*prev);
     dirty.insert(prev_it, *next);
@@ -454,17 +454,18 @@ Cache::get_next_dirty_extents_ret Cache::get_next_dirty_extents(
        i != dirty.end() && bytes_so_far < max_bytes;
        ++i) {
     CachedExtentRef cand;
-    if (i->dirty_from != journal_seq_t() && i->dirty_from < seq) {
+    if (i->get_dirty_from() != journal_seq_t() && i->get_dirty_from() < seq) {
       logger().debug(
        "Cache::get_next_dirty_extents: next {}",
        *i);
-      if (!(ret.empty() || ret.back()->dirty_from <= i->dirty_from)) {
+      if (!(ret.empty() ||
+           ret.back()->get_dirty_from() <= i->get_dirty_from())) {
        logger().debug(
          "Cache::get_next_dirty_extents: last {}, next {}",
          *ret.back(),
          *i);
       }
-      assert(ret.empty() || ret.back()->dirty_from <= i->dirty_from);
+      assert(ret.empty() || ret.back()->get_dirty_from() <= i->get_dirty_from());
       bytes_so_far += i->get_length();
       ret.push_back(&*i);
     } else {
index c48f27eaa511aa785643d5f45d5246ff4aa2481c..bfb2248f961256c5e1ddfea2793067abab2346be 100644 (file)
@@ -496,7 +496,7 @@ public:
     return out;
   }
 
-  /// returns extents with dirty_from < seq
+  /// returns extents with get_dirty_from() < seq
   using get_next_dirty_extents_ertr = crimson::errorator<>;
   using get_next_dirty_extents_ret = get_next_dirty_extents_ertr::future<
     std::vector<CachedExtentRef>>;
@@ -504,12 +504,12 @@ public:
     journal_seq_t seq,
     size_t max_bytes);
 
-  /// returns std::nullopt if no dirty extents or dirty_from for oldest
+  /// returns std::nullopt if no dirty extents or get_dirty_from() for oldest
   std::optional<journal_seq_t> get_oldest_dirty_from() const {
     if (dirty.empty()) {
       return std::nullopt;
     } else {
-      auto oldest = dirty.begin()->dirty_from;
+      auto oldest = dirty.begin()->get_dirty_from();
       if (oldest == journal_seq_t()) {
        return std::nullopt;
       } else {
@@ -526,7 +526,7 @@ private:
   /**
    * dirty
    *
-   * holds refs to dirty extents.  Ordered by CachedExtent::dirty_from.
+   * holds refs to dirty extents.  Ordered by CachedExtent::get_dirty_from().
    */
   CachedExtent::list dirty;