]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: misc cleanup
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 28 Sep 2021 06:54:22 +0000 (14:54 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Tue, 28 Sep 2021 08:31:08 +0000 (16:31 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cache.h

index f1c79c21c4ff60335ce2f22e0776f6508fed0833..2b854cee03b537001ca1523054b02116886535ff 100644 (file)
@@ -538,7 +538,7 @@ void Cache::retire_extent(CachedExtentRef ref)
   remove_from_dirty(ref);
   ref->dirty_from_or_retired_at = JOURNAL_SEQ_MAX;
 
-  invalidate(*ref);
+  invalidate_extent(*ref);
   extents.erase(*ref);
 }
 
@@ -571,27 +571,27 @@ void Cache::replace_extent(CachedExtentRef next, CachedExtentRef prev)
     add_to_dirty(next);
   }
 
-  invalidate(*prev);
+  invalidate_extent(*prev);
 }
 
-void Cache::invalidate(CachedExtent &extent)
+void Cache::invalidate_extent(CachedExtent &extent)
 {
   LOG_PREFIX(Cache::invalidate);
-  DEBUG("invalidate begin -- extent {}", extent);
+  DEBUG("conflict begin -- extent {}", extent);
   for (auto &&i: extent.transactions) {
     if (!i.t->conflicted) {
       assert(!i.t->is_weak());
       mark_transaction_conflicted(*i.t, extent);
     }
   }
-  DEBUG("invalidate end");
+  DEBUG("conflict end");
   extent.state = CachedExtent::extent_state_t::INVALID;
 }
 
 void Cache::mark_transaction_conflicted(
   Transaction& t, CachedExtent& conflicting_extent)
 {
-  LOG_PREFIX(Cache::invalidate);
+  LOG_PREFIX(Cache::mark_transaction_conflicted);
   assert(!t.conflicted);
   DEBUGT("set conflict", t);
   t.conflicted = true;
@@ -847,11 +847,10 @@ record_t Cache::prepare_record(Transaction &t)
   record.extents.reserve(t.inline_block_list.size());
   for (auto &i: t.inline_block_list) {
     DEBUGT("fresh block {}", t, *i);
-    if (!i->is_inline()) {
-      continue;
-    }
     get_by_ext(efforts.fresh_by_ext,
                i->get_type()).increment(i->get_length());
+    assert(i->is_inline());
+
     bufferlist bl;
     i->prepare_write();
     bl.append(i->get_bptr());
@@ -881,7 +880,6 @@ void Cache::complete_commit(
   LOG_PREFIX(Cache::complete_commit);
   DEBUGT("enter", t);
 
-  
   t.for_each_fresh_block([&](auto &i) {
     if (i->is_inline()) {
       i->set_paddr(final_block_start.add_relative(i->get_paddr()));
index 7ae90a9b038af2d3174d1f3a53e10bf6473aba59..c8049ca29ca4be8b06cd494456ae4857969fe2ed 100644 (file)
@@ -757,7 +757,7 @@ private:
   void replace_extent(CachedExtentRef next, CachedExtentRef prev);
 
   /// Invalidate extent and mark affected transactions
-  void invalidate(CachedExtent &extent);
+  void invalidate_extent(CachedExtent &extent);
 
   /// Mark a valid transaction as conflicted
   void mark_transaction_conflicted(