diff options
author | Yingxin Cheng <yingxin.cheng@intel.com> | 2022-11-07 09:42:58 +0100 |
---|---|---|
committer | Yingxin Cheng <yingxin.cheng@intel.com> | 2022-11-07 12:06:02 +0100 |
commit | 5f4cb5b5a4d945cd0812f6de333089217b27464a (patch) | |
tree | 21a5ad7d5cb11bbb810630e9afecebcb84a53f21 /src/crimson/os/seastore/async_cleaner.h | |
parent | Merge pull request #48712 from zdover23/wip-doc-2022-11-03-cephadm-compatibil... (diff) | |
download | ceph-5f4cb5b5a4d945cd0812f6de333089217b27464a.tar.xz ceph-5f4cb5b5a4d945cd0812f6de333089217b27464a.zip |
crimson/os/seastore: define the usage of generation
Unify the definition of the reclaim generation, cleanup and explain its
intentions and usages. Please refer to the comments in seastore_types.h.
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
Diffstat (limited to 'src/crimson/os/seastore/async_cleaner.h')
-rw-r--r-- | src/crimson/os/seastore/async_cleaner.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/crimson/os/seastore/async_cleaner.h b/src/crimson/os/seastore/async_cleaner.h index ded2a3da8ac..eb09464e6e4 100644 --- a/src/crimson/os/seastore/async_cleaner.h +++ b/src/crimson/os/seastore/async_cleaner.h @@ -1085,10 +1085,20 @@ private: segment_id_t segment_id, reclaim_gen_t generation, segment_off_t segment_size) { - ceph_assert(generation < RECLAIM_GENERATIONS); + ceph_assert(is_reclaim_generation(generation)); + + reclaim_gen_t target_gen; + if (generation < MIN_REWRITE_GENERATION) { + target_gen = MIN_REWRITE_GENERATION; + } else { + // tolerate the target_gen to exceed MAX_REWRETE_GENERATION to make EPM + // aware of its original generation for the decisions. + target_gen = generation + 1; + } + + assert(is_target_reclaim_generation(target_gen)); return {generation, - (reclaim_gen_t)(generation == RECLAIM_GENERATIONS - 1 ? - generation : generation + 1), + target_gen, segment_size, P_ADDR_NULL, paddr_t::make_seg_paddr(segment_id, 0)}; |