librbd: drop ValidatePoolRequest::m_op_work_queue

It is unused now.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
Ilya Dryomov 2021-09-04 13:49:09 +02:00
parent 56d41a9ada
commit ba04352b8f
5 changed files with 13 additions and 29 deletions

View File

@ -252,11 +252,8 @@ int Pool<I>::init(librados::IoCtx& io_ctx, bool force) {
return 0;
}
AsioEngine asio_engine(io_ctx);
C_SaferCond ctx;
auto req = image::ValidatePoolRequest<I>::create(
io_ctx, asio_engine.get_work_queue(), &ctx);
auto req = image::ValidatePoolRequest<I>::create(io_ctx, &ctx);
req->send();
return ctx.wait();

View File

@ -283,8 +283,7 @@ void CreateRequest<I>::validate_data_pool() {
auto ctx = create_context_callback<
CreateRequest<I>, &CreateRequest<I>::handle_validate_data_pool>(this);
auto req = ValidatePoolRequest<I>::create(m_data_io_ctx, m_op_work_queue,
ctx);
auto req = ValidatePoolRequest<I>::create(m_data_io_ctx, ctx);
req->send();
}

View File

@ -31,10 +31,9 @@ using util::create_async_context_callback;
template <typename I>
ValidatePoolRequest<I>::ValidatePoolRequest(librados::IoCtx& io_ctx,
asio::ContextWQ *op_work_queue,
Context *on_finish)
: m_cct(reinterpret_cast<CephContext*>(io_ctx.cct())),
m_op_work_queue(op_work_queue), m_on_finish(on_finish) {
m_on_finish(on_finish) {
// validatation should occur in default namespace
m_io_ctx.dup(io_ctx);
m_io_ctx.set_namespace("");

View File

@ -21,13 +21,11 @@ template <typename ImageCtxT>
class ValidatePoolRequest {
public:
static ValidatePoolRequest* create(librados::IoCtx& io_ctx,
asio::ContextWQ *op_work_queue,
Context *on_finish) {
return new ValidatePoolRequest(io_ctx, op_work_queue, on_finish);
return new ValidatePoolRequest(io_ctx, on_finish);
}
ValidatePoolRequest(librados::IoCtx& io_ctx, asio::ContextWQ *op_work_queue,
Context *on_finish);
ValidatePoolRequest(librados::IoCtx& io_ctx, Context *on_finish);
void send();
@ -62,7 +60,6 @@ private:
librados::IoCtx m_io_ctx;
CephContext* m_cct;
asio::ContextWQ* m_op_work_queue;
Context* m_on_finish;
int m_ret_val = 0;

View File

@ -110,8 +110,7 @@ TEST_F(TestMockImageValidatePoolRequest, Success) {
expect_write_rbd_info(mock_io_ctx, "overwrite validated", 0);
C_SaferCond ctx;
auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
&ctx);
auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
}
@ -124,8 +123,7 @@ TEST_F(TestMockImageValidatePoolRequest, AlreadyValidated) {
expect_read_rbd_info(mock_io_ctx, "overwrite validated", 0);
C_SaferCond ctx;
auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
&ctx);
auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
}
@ -139,8 +137,7 @@ TEST_F(TestMockImageValidatePoolRequest, SnapshotsValidated) {
expect_write_rbd_info(mock_io_ctx, "overwrite validated", 0);
C_SaferCond ctx;
auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
&ctx);
auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
}
@ -153,8 +150,7 @@ TEST_F(TestMockImageValidatePoolRequest, ReadError) {
expect_read_rbd_info(mock_io_ctx, "", -EPERM);
C_SaferCond ctx;
auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
&ctx);
auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
req->send();
ASSERT_EQ(-EPERM, ctx.wait());
}
@ -168,8 +164,7 @@ TEST_F(TestMockImageValidatePoolRequest, CreateSnapshotError) {
expect_allocate_snap_id(mock_io_ctx, -EPERM);
C_SaferCond ctx;
auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
&ctx);
auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
req->send();
ASSERT_EQ(-EPERM, ctx.wait());
}
@ -185,8 +180,7 @@ TEST_F(TestMockImageValidatePoolRequest, WriteError) {
expect_release_snap_id(mock_io_ctx, -EINVAL);
C_SaferCond ctx;
auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
&ctx);
auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
req->send();
ASSERT_EQ(-EPERM, ctx.wait());
}
@ -203,8 +197,7 @@ TEST_F(TestMockImageValidatePoolRequest, RemoveSnapshotError) {
expect_write_rbd_info(mock_io_ctx, "overwrite validated", 0);
C_SaferCond ctx;
auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
&ctx);
auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
req->send();
ASSERT_EQ(0, ctx.wait());
}
@ -221,8 +214,7 @@ TEST_F(TestMockImageValidatePoolRequest, OverwriteError) {
expect_write_rbd_info(mock_io_ctx, "overwrite validated", -EOPNOTSUPP);
C_SaferCond ctx;
auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
&ctx);
auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
req->send();
ASSERT_EQ(-EINVAL, ctx.wait());
}