test/crimson/sesastore/test_block: add constructor to construct

non-fully-loaded TestBlocks

Before this commit, all TestBlocks are fully-loaded whether they do have
data or not.

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
This commit is contained in:
Xuehan Xu 2024-03-15 19:48:33 +08:00
parent 758a0bcef5
commit 61d7f8821f

View File

@ -55,6 +55,8 @@ struct TestBlock : crimson::os::seastore::LogicalCachedExtent {
: LogicalCachedExtent(std::move(ptr)) {}
TestBlock(const TestBlock &other)
: LogicalCachedExtent(other), modified_region(other.modified_region) {}
TestBlock(extent_len_t length)
: LogicalCachedExtent(length) {}
CachedExtentRef duplicate_for_write(Transaction&) final {
return CachedExtentRef(new TestBlock(*this));