}
void finish(int r) override {
+ ldout(image_ctx->cct, 20) << "aligned read r=" << r << dendl;
on_finish->complete(r);
}
void handle_read(int r) {
auto cct = image_ctx->cct;
- ldout(cct, 20) << "r=" << r << dendl;
+ ldout(cct, 20) << "aligned read r=" << r << dendl;
if (r == 0) {
for (auto& extent: *extents) {
auto crypto_ret = crypto->decrypt_aligned_extent(
}
void finish(int r) override {
- ldout(cct, 20) << "r=" << r << dendl;
+ ldout(cct, 20) << "unaligned read r=" << r << dendl;
if (r >= 0) {
remove_alignment_data();
}
void handle_read(int r) {
- ldout(image_ctx->cct, 20) << "r=" << r << dendl;
+ ldout(image_ctx->cct, 20) << "unaligned write r=" << r << dendl;
if (r == -ENOENT) {
auto ctx = create_context_callback<
}
void handle_write(int r) {
+ ldout(image_ctx->cct, 20) << "r=" << r << dendl;
bool exclusive = write_flags & io::OBJECT_WRITE_FLAG_CREATE_EXCLUSIVE;
bool restart = false;
if (r == -ERANGE && !assert_version.has_value()) {
}
void finish(int r) override {
+ ldout(image_ctx->cct, 20) << "unaligned write r=" << r << dendl;
on_finish->complete(r);
}
};
ASSERT_EQ(on_finish, &finished_cond);
ASSERT_EQ(ETIMEDOUT, dispatched_cond.wait_for(0));
- dispatcher_ctx->complete(0);
+ dispatcher_ctx->complete(4096*8);
ASSERT_EQ(3 + 4096 * 5 - 2, dispatched_cond.wait());
ASSERT_TRUE(extents[0].bl.to_str() == std::string("1"));
ASSERT_TRUE(extents[1].bl.to_str() == std::string("2"));
auto expected_data =
std::string("2") + std::string(8192, '1') + std::string(4095, '3');
expect_object_write(0, expected_data, 0, std::make_optional(version));
- dispatcher_ctx->complete(0); // complete read
+ dispatcher_ctx->complete(8192); // complete read
ASSERT_EQ(ETIMEDOUT, dispatched_cond.wait_for(0));
dispatcher_ctx->complete(0); // complete write
ASSERT_EQ(0, dispatched_cond.wait());
auto expected_data2 =
std::string("2") + std::string(8192, '1') + std::string(4095, '3');
expect_object_write(0, expected_data2, 0, std::make_optional(version));
- dispatcher_ctx->complete(0); // complete read
+ dispatcher_ctx->complete(8192); // complete read
ASSERT_EQ(ETIMEDOUT, dispatched_cond.wait_for(0));
dispatcher_ctx->complete(0); // complete write
ASSERT_EQ(0, dispatched_cond.wait());
auto expected_data =
std::string("2") + std::string(8192, '1') + std::string(4095, '3');
expect_object_write(0, expected_data, 0, std::make_optional(version));
- dispatcher_ctx->complete(0); // complete second read
+ dispatcher_ctx->complete(8192); // complete second read
ASSERT_EQ(ETIMEDOUT, dispatched_cond.wait_for(0));
dispatcher_ctx->complete(0); // complete write
ASSERT_EQ(0, dispatched_cond.wait());
auto expected_data =
std::string("2") + std::string(8192, '1') + std::string(4095, '3');
expect_object_write(0, expected_data, 0, std::make_optional(version));
- dispatcher_ctx->complete(0); // complete read
+ dispatcher_ctx->complete(8192); // complete read
ASSERT_EQ(ETIMEDOUT, dispatched_cond.wait_for(0));
version = 1235;
ASSERT_EQ(ETIMEDOUT, dispatched_cond.wait_for(0));
expect_object_write(0, expected_data, 0, std::make_optional(version));
- dispatcher_ctx->complete(0); // complete read
+ dispatcher_ctx->complete(8192); // complete read
ASSERT_EQ(ETIMEDOUT, dispatched_cond.wait_for(0));
dispatcher_ctx->complete(0); // complete write
ASSERT_EQ(0, dispatched_cond.wait());
ASSERT_EQ(dispatch_result, io::DISPATCH_RESULT_COMPLETE);
ASSERT_EQ(on_finish, &finished_cond);
- dispatcher_ctx->complete(0); // complete read
+ dispatcher_ctx->complete(8192); // complete read
ASSERT_EQ(-ERANGE, dispatched_cond.wait());
}
ASSERT_EQ(dispatch_result, io::DISPATCH_RESULT_COMPLETE);
ASSERT_EQ(on_finish, &finished_cond);
- dispatcher_ctx->complete(0); // complete read
+ dispatcher_ctx->complete(8192); // complete read
ASSERT_EQ(-EEXIST, dispatched_cond.wait());
}
auto expected_data =
std::string("2") + std::string(8192, '1') + std::string(4095, '3');
expect_object_write(0, expected_data, 0, std::make_optional(version));
- dispatcher_ctx->complete(0); // complete read
+ dispatcher_ctx->complete(4096*4); // complete read
ASSERT_EQ(ETIMEDOUT, dispatched_cond.wait_for(0));
dispatcher_ctx->complete(0); // complete write
ASSERT_EQ(0, dispatched_cond.wait());
ASSERT_EQ(dispatch_result, io::DISPATCH_RESULT_COMPLETE);
ASSERT_EQ(on_finish, &finished_cond);
- dispatcher_ctx->complete(0); // complete read
+ dispatcher_ctx->complete(4096*4); // complete read
ASSERT_EQ(-EILSEQ, dispatched_cond.wait());
ASSERT_EQ(mismatch_offset, 4094);
}