Skip to content

Commit

Permalink
test/crimson/seastore/test_object_data_handler: remap pins through the
Browse files Browse the repository at this point in the history
transaction that created the pins

Fixes: https://tracker.ceph.com/issues/65610
Signed-off-by: Xuehan Xu <[email protected]>
  • Loading branch information
xxhdx1985126 committed Apr 22, 2024
1 parent eae1b31 commit 02acc0a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/test/crimson/seastore/test_object_data_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ struct object_data_handler_test_t:
}
}
}
std::list<LBAMappingRef> get_mappings(
Transaction &t,
objaddr_t offset,
extent_len_t length) {
auto ret = with_trans_intr(t, [&](auto &t) {
return tm->get_pins(t, offset, length);
}).unsafe_get0();
return ret;
}
std::list<LBAMappingRef> get_mappings(objaddr_t offset, extent_len_t length) {
auto t = create_mutate_transaction();
auto ret = with_trans_intr(*t, [&](auto &t) {
Expand Down Expand Up @@ -758,7 +767,7 @@ TEST_P(object_data_handler_test_t, overwrite_then_read_within_transaction) {

t = create_mutate_transaction();
{
auto pins = get_mappings(base, len);
auto pins = get_mappings(*t, base, len);
assert(pins.size() == 1);
auto pin1 = remap_pin(*t, std::move(pins.front()), 4096, 8192);
auto ext = get_extent(*t, base + 4096, 4096 * 2);
Expand Down

0 comments on commit 02acc0a

Please sign in to comment.