tests: integrate cleaned up librbd AIO callback adapter

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2015-11-11 21:44:02 -05:00
parent 004090a660
commit 06f2eb29c9
2 changed files with 8 additions and 14 deletions

View File

@ -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());

View File

@ -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);