Skip to content

Commit bd6e6f0

Browse files
committed
crimson/os/seastore: move counter_by_extent_t definition
Signed-off-by: Yingxin Cheng <[email protected]>
1 parent 280dd13 commit bd6e6f0

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/crimson/os/seastore/cache.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,9 +1507,6 @@ class Cache {
15071507
uint64_t hit = 0;
15081508
};
15091509

1510-
template <typename CounterT>
1511-
using counter_by_extent_t = std::array<CounterT, EXTENT_TYPES_MAX>;
1512-
15131510
struct invalid_trans_efforts_t {
15141511
io_stat_t read;
15151512
io_stat_t mutate;
@@ -1593,15 +1590,6 @@ class Cache {
15931590
version_stat_t committed_reclaim_version;
15941591
} stats;
15951592

1596-
template <typename CounterT>
1597-
CounterT& get_by_ext(
1598-
counter_by_extent_t<CounterT>& counters_by_ext,
1599-
extent_types_t ext) {
1600-
auto index = static_cast<uint8_t>(ext);
1601-
assert(index < EXTENT_TYPES_MAX);
1602-
return counters_by_ext[index];
1603-
}
1604-
16051593
void account_conflict(Transaction::src_t src1, Transaction::src_t src2) {
16061594
assert(src1 < Transaction::src_t::MAX);
16071595
assert(src2 < Transaction::src_t::MAX);

src/crimson/os/seastore/seastore_types.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,18 @@ void minus_srcs(counter_by_src_t<CounterT>& base,
23302330
}
23312331
}
23322332

2333+
template <typename CounterT>
2334+
using counter_by_extent_t = std::array<CounterT, EXTENT_TYPES_MAX>;
2335+
2336+
template <typename CounterT>
2337+
CounterT& get_by_ext(
2338+
counter_by_extent_t<CounterT>& counters_by_ext,
2339+
extent_types_t ext) {
2340+
auto index = static_cast<uint8_t>(ext);
2341+
assert(index < EXTENT_TYPES_MAX);
2342+
return counters_by_ext[index];
2343+
}
2344+
23332345
struct grouped_io_stats {
23342346
uint64_t num_io = 0;
23352347
uint64_t num_io_grouped = 0;

0 commit comments

Comments
 (0)