]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: move counter_by_extent_t definition
authorYingxin Cheng <yingxin.cheng@intel.com>
Fri, 9 Aug 2024 08:01:39 +0000 (16:01 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 15 Aug 2024 05:45:27 +0000 (13:45 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/cache.h
src/crimson/os/seastore/seastore_types.h

index 681879b13a0bf574695bb0b6286a80c33ebe3e76..3b2213c4b109ee98e751a4022ce815bbaeb65b1f 100644 (file)
@@ -1507,9 +1507,6 @@ private:
     uint64_t hit = 0;
   };
 
-  template <typename CounterT>
-  using counter_by_extent_t = std::array<CounterT, EXTENT_TYPES_MAX>;
-
   struct invalid_trans_efforts_t {
     io_stat_t read;
     io_stat_t mutate;
@@ -1593,15 +1590,6 @@ private:
     version_stat_t committed_reclaim_version;
   } stats;
 
-  template <typename CounterT>
-  CounterT& get_by_ext(
-      counter_by_extent_t<CounterT>& counters_by_ext,
-      extent_types_t ext) {
-    auto index = static_cast<uint8_t>(ext);
-    assert(index < EXTENT_TYPES_MAX);
-    return counters_by_ext[index];
-  }
-
   void account_conflict(Transaction::src_t src1, Transaction::src_t src2) {
     assert(src1 < Transaction::src_t::MAX);
     assert(src2 < Transaction::src_t::MAX);
index 1713b98a0929b66705d1d3754c998497f33fb137..f13349606684c4f2041d17904cc76930261e1015 100644 (file)
@@ -2330,6 +2330,18 @@ void minus_srcs(counter_by_src_t<CounterT>& base,
   }
 }
 
+template <typename CounterT>
+using counter_by_extent_t = std::array<CounterT, EXTENT_TYPES_MAX>;
+
+template <typename CounterT>
+CounterT& get_by_ext(
+    counter_by_extent_t<CounterT>& counters_by_ext,
+    extent_types_t ext) {
+  auto index = static_cast<uint8_t>(ext);
+  assert(index < EXTENT_TYPES_MAX);
+  return counters_by_ext[index];
+}
+
 struct grouped_io_stats {
   uint64_t num_io = 0;
   uint64_t num_io_grouped = 0;