]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: cleanup remove_from_dirty()
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 1 Aug 2024 08:46:39 +0000 (16:46 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Wed, 14 Aug 2024 07:44:46 +0000 (15:44 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/cache.cc

index fcc3507f9d9498009a15f12cc60c016676df974e..6963e3d351df9cc93ea3ecd9fdd028850d73e2ee 100644 (file)
@@ -766,14 +766,11 @@ void Cache::add_to_dirty(CachedExtentRef ref)
 
 void Cache::remove_from_dirty(CachedExtentRef ref)
 {
-  if (ref->is_dirty()) {
-    ceph_assert(ref->primary_ref_list_hook.is_linked());
-    stats.dirty_bytes -= ref->get_length();
-    dirty.erase(dirty.s_iterator_to(*ref));
-    intrusive_ptr_release(&*ref);
-  } else {
-    ceph_assert(!ref->primary_ref_list_hook.is_linked());
-  }
+  assert(ref->is_dirty());
+  ceph_assert(ref->primary_ref_list_hook.is_linked());
+  stats.dirty_bytes -= ref->get_length();
+  dirty.erase(dirty.s_iterator_to(*ref));
+  intrusive_ptr_release(&*ref);
 }
 
 void Cache::remove_extent(CachedExtentRef ref)