From bd6e6f00306d313e8a8ab8a61c0b11564259ca60 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Fri, 9 Aug 2024 16:01:39 +0800 Subject: [PATCH] crimson/os/seastore: move counter_by_extent_t definition Signed-off-by: Yingxin Cheng --- src/crimson/os/seastore/cache.h | 12 ------------ src/crimson/os/seastore/seastore_types.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index 681879b13a0bf..3b2213c4b109e 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -1507,9 +1507,6 @@ private: uint64_t hit = 0; }; - template - using counter_by_extent_t = std::array; - 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 - CounterT& get_by_ext( - counter_by_extent_t& counters_by_ext, - extent_types_t ext) { - auto index = static_cast(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); diff --git a/src/crimson/os/seastore/seastore_types.h b/src/crimson/os/seastore/seastore_types.h index 1713b98a0929b..f13349606684c 100644 --- a/src/crimson/os/seastore/seastore_types.h +++ b/src/crimson/os/seastore/seastore_types.h @@ -2330,6 +2330,18 @@ void minus_srcs(counter_by_src_t& base, } } +template +using counter_by_extent_t = std::array; + +template +CounterT& get_by_ext( + counter_by_extent_t& counters_by_ext, + extent_types_t ext) { + auto index = static_cast(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; -- 2.39.5