mirror of
https://github.com/ceph/ceph
synced 2024-12-28 14:34:13 +00:00
tests: integrate cleaned up librbd AIO callback adapter
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
parent
004090a660
commit
06f2eb29c9
@ -125,8 +125,7 @@ TEST_F(TestJournalEntries, AioWrite) {
|
||||
|
||||
std::string buffer(512, '1');
|
||||
C_SaferCond cond_ctx;
|
||||
librbd::AioCompletion *c =
|
||||
librbd::aio_create_completion_internal(&cond_ctx, librbd::rbd_ctx_cb);
|
||||
librbd::AioCompletion *c = librbd::AioCompletion::create(&cond_ctx);
|
||||
c->get();
|
||||
ictx->aio_work_queue->aio_write(c, 123, buffer.size(), buffer.c_str(), 0);
|
||||
ASSERT_EQ(0, c->wait_for_complete());
|
||||
@ -163,8 +162,7 @@ TEST_F(TestJournalEntries, AioDiscard) {
|
||||
ASSERT_TRUE(journaler != NULL);
|
||||
|
||||
C_SaferCond cond_ctx;
|
||||
librbd::AioCompletion *c =
|
||||
librbd::aio_create_completion_internal(&cond_ctx, librbd::rbd_ctx_cb);
|
||||
librbd::AioCompletion *c = librbd::AioCompletion::create(&cond_ctx);
|
||||
c->get();
|
||||
ictx->aio_work_queue->aio_discard(c, 123, 234);
|
||||
ASSERT_EQ(0, c->wait_for_complete());
|
||||
@ -197,8 +195,7 @@ TEST_F(TestJournalEntries, AioFlush) {
|
||||
ASSERT_TRUE(journaler != NULL);
|
||||
|
||||
C_SaferCond cond_ctx;
|
||||
librbd::AioCompletion *c =
|
||||
librbd::aio_create_completion_internal(&cond_ctx, librbd::rbd_ctx_cb);
|
||||
librbd::AioCompletion *c = librbd::AioCompletion::create(&cond_ctx);
|
||||
c->get();
|
||||
ictx->aio_work_queue->aio_flush(c);
|
||||
ASSERT_EQ(0, c->wait_for_complete());
|
||||
|
@ -252,9 +252,8 @@ TEST_F(TestInternal, AioWriteRequestsLock) {
|
||||
ASSERT_EQ(0, lock_image(*ictx, LOCK_EXCLUSIVE, "manually locked"));
|
||||
|
||||
std::string buffer(256, '1');
|
||||
DummyContext *ctx = new DummyContext();
|
||||
librbd::AioCompletion *c =
|
||||
librbd::aio_create_completion_internal(ctx, librbd::rbd_ctx_cb);
|
||||
Context *ctx = new DummyContext();
|
||||
librbd::AioCompletion *c = librbd::AioCompletion::create(ctx);
|
||||
c->get();
|
||||
ictx->aio_work_queue->aio_write(c, 0, buffer.size(), buffer.c_str(), 0);
|
||||
|
||||
@ -275,9 +274,8 @@ TEST_F(TestInternal, AioDiscardRequestsLock) {
|
||||
ASSERT_EQ(0, open_image(m_image_name, &ictx));
|
||||
ASSERT_EQ(0, lock_image(*ictx, LOCK_EXCLUSIVE, "manually locked"));
|
||||
|
||||
DummyContext *ctx = new DummyContext();
|
||||
librbd::AioCompletion *c =
|
||||
librbd::aio_create_completion_internal(ctx, librbd::rbd_ctx_cb);
|
||||
Context *ctx = new DummyContext();
|
||||
librbd::AioCompletion *c = librbd::AioCompletion::create(ctx);
|
||||
c->get();
|
||||
ictx->aio_work_queue->aio_discard(c, 0, 256);
|
||||
|
||||
@ -661,8 +659,7 @@ TEST_F(TestInternal, ShrinkFlushesCache) {
|
||||
ictx->aio_work_queue->write(0, buffer.size(), buffer.c_str(), 0);
|
||||
|
||||
C_SaferCond cond_ctx;
|
||||
librbd::AioCompletion *c =
|
||||
librbd::aio_create_completion_internal(&cond_ctx, librbd::rbd_ctx_cb);
|
||||
librbd::AioCompletion *c = librbd::AioCompletion::create(&cond_ctx);
|
||||
c->get();
|
||||
ictx->aio_work_queue->aio_write(c, 0, buffer.size(), buffer.c_str(), 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user