From: Yingxin Cheng Date: Fri, 9 Aug 2024 08:01:39 +0000 (+0800) Subject: crimson/os/seastore: move counter_by_extent_t definition X-Git-Tag: v20.0.0~1251^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd6e6f00306d313e8a8ab8a61c0b11564259ca60;p=ceph.git crimson/os/seastore: move counter_by_extent_t definition Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index 681879b13a0b..3b2213c4b109 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 1713b98a0929..f13349606684 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;