#include "common/Finisher.h"
#include "common/valgrind.h"
#include "objclass/objclass.h"
-#include <boost/bind.hpp>
+#include <functional>
#include <errno.h>
namespace librados {
// TODO flags for now
ops.get();
m_pending_ops++;
- m_client->add_aio_operation(oid, true, boost::bind(
+ m_client->add_aio_operation(oid, true, std::bind(
&TestIoCtxImpl::execute_aio_operations, this, oid, &ops,
- reinterpret_cast<bufferlist*>(0),
- snap_context != NULL ? *snap_context : m_snapc), c);
+ reinterpret_cast<bufferlist*>(0), m_snap_seq,
+ snap_context != NULL ? *snap_context : m_snapc, nullptr), c);
return 0;
}
int TestIoCtxImpl::aio_operate_read(const std::string& oid,
TestObjectOperationImpl &ops,
AioCompletionImpl *c, int flags,
- bufferlist *pbl) {
+ bufferlist *pbl, uint64_t snap_id,
+ uint64_t* objver) {
// TODO ignoring flags for now
ops.get();
m_pending_ops++;
- m_client->add_aio_operation(oid, true, boost::bind(
- &TestIoCtxImpl::execute_aio_operations, this, oid, &ops, pbl, m_snapc), c);
+ m_client->add_aio_operation(oid, true, std::bind(
+ &TestIoCtxImpl::execute_aio_operations, this, oid, &ops, pbl, snap_id,
+ m_snapc, objver), c);
return 0;
}
m_pending_ops++;
c->get();
C_AioNotify *ctx = new C_AioNotify(this, c);
- if (m_client->is_blacklisted()) {
- m_client->get_aio_finisher()->queue(ctx, -EBLACKLISTED);
+ if (m_client->is_blocklisted()) {
+ m_client->get_aio_finisher()->queue(ctx, -EBLOCKLISTED);
} else {
m_client->get_watch_notify()->aio_watch(m_client, m_pool_id,
get_namespace(), o,
m_pending_ops++;
c->get();
C_AioNotify *ctx = new C_AioNotify(this, c);
- if (m_client->is_blacklisted()) {
- m_client->get_aio_finisher()->queue(ctx, -EBLACKLISTED);
+ if (m_client->is_blocklisted()) {
+ m_client->get_aio_finisher()->queue(ctx, -EBLOCKLISTED);
} else {
m_client->get_watch_notify()->aio_unwatch(m_client, handle, ctx);
}
int TestIoCtxImpl::exec(const std::string& oid, TestClassHandler *handler,
const char *cls, const char *method,
bufferlist& inbl, bufferlist* outbl,
- const SnapContext &snapc) {
- if (m_client->is_blacklisted()) {
- return -EBLACKLISTED;
+ uint64_t snap_id, const SnapContext &snapc) {
+ if (m_client->is_blocklisted()) {
+ return -EBLOCKLISTED;
}
cls_method_cxx_call_t call = handler->get_method(cls, method);
}
return (*call)(reinterpret_cast<cls_method_context_t>(
- handler->get_method_context(this, oid, snapc).get()), &inbl, outbl);
+ handler->get_method_context(this, oid, snap_id, snapc).get()), &inbl,
+ outbl);
}
int TestIoCtxImpl::list_watchers(const std::string& o,
std::list<obj_watch_t> *out_watchers) {
- if (m_client->is_blacklisted()) {
- return -EBLACKLISTED;
+ if (m_client->is_blocklisted()) {
+ return -EBLOCKLISTED;
}
return m_client->get_watch_notify()->list_watchers(m_pool_id, get_namespace(),
int TestIoCtxImpl::notify(const std::string& o, bufferlist& bl,
uint64_t timeout_ms, bufferlist *pbl) {
- if (m_client->is_blacklisted()) {
- return -EBLACKLISTED;
+ if (m_client->is_blocklisted()) {
+ return -EBLOCKLISTED;
}
return m_client->get_watch_notify()->notify(m_client, m_pool_id,
m_client->get_instance_id(), bl);
}
-int TestIoCtxImpl::operate(const std::string& oid, TestObjectOperationImpl &ops) {
+int TestIoCtxImpl::operate(const std::string& oid,
+ TestObjectOperationImpl &ops) {
AioCompletionImpl *comp = new AioCompletionImpl();
ops.get();
m_pending_ops++;
- m_client->add_aio_operation(oid, false, boost::bind(
+ m_client->add_aio_operation(oid, false, std::bind(
&TestIoCtxImpl::execute_aio_operations, this, oid, &ops,
- reinterpret_cast<bufferlist*>(0), m_snapc), comp);
+ reinterpret_cast<bufferlist*>(0), m_snap_seq, m_snapc, nullptr), comp);
comp->wait_for_complete();
int ret = comp->get_return_value();
return ret;
}
-int TestIoCtxImpl::operate_read(const std::string& oid, TestObjectOperationImpl &ops,
+int TestIoCtxImpl::operate_read(const std::string& oid,
+ TestObjectOperationImpl &ops,
bufferlist *pbl) {
AioCompletionImpl *comp = new AioCompletionImpl();
ops.get();
m_pending_ops++;
- m_client->add_aio_operation(oid, false, boost::bind(
+ m_client->add_aio_operation(oid, false, std::bind(
&TestIoCtxImpl::execute_aio_operations, this, oid, &ops, pbl,
- m_snapc), comp);
+ m_snap_seq, m_snapc, nullptr), comp);
comp->wait_for_complete();
int ret = comp->get_return_value();
AioCompletionImpl *c) {
m_client->add_aio_operation(
"", true,
- boost::bind(&TestIoCtxImpl::selfmanaged_snap_create, this, snapid), c);
+ std::bind(&TestIoCtxImpl::selfmanaged_snap_create, this, snapid), c);
}
void TestIoCtxImpl::aio_selfmanaged_snap_remove(uint64_t snapid,
AioCompletionImpl *c) {
m_client->add_aio_operation(
"", true,
- boost::bind(&TestIoCtxImpl::selfmanaged_snap_remove, this, snapid), c);
+ std::bind(&TestIoCtxImpl::selfmanaged_snap_remove, this, snapid), c);
}
int TestIoCtxImpl::selfmanaged_snap_set_write_ctx(snap_t seq,
}
int TestIoCtxImpl::tmap_update(const std::string& oid, bufferlist& cmdbl) {
- if (m_client->is_blacklisted()) {
- return -EBLACKLISTED;
+ if (m_client->is_blocklisted()) {
+ return -EBLOCKLISTED;
}
// TODO: protect against concurrent tmap updates
if (size > 0) {
bufferlist inbl;
- r = read(oid, size, 0, &inbl);
+ r = read(oid, size, 0, &inbl, CEPH_NOSNAP, nullptr);
if (r < 0) {
return r;
}
}
int TestIoCtxImpl::unwatch(uint64_t handle) {
- if (m_client->is_blacklisted()) {
- return -EBLACKLISTED;
+ if (m_client->is_blocklisted()) {
+ return -EBLOCKLISTED;
}
return m_client->get_watch_notify()->unwatch(m_client, handle);
int TestIoCtxImpl::watch(const std::string& o, uint64_t *handle,
librados::WatchCtx *ctx, librados::WatchCtx2 *ctx2) {
- if (m_client->is_blacklisted()) {
- return -EBLACKLISTED;
+ if (m_client->is_blocklisted()) {
+ return -EBLOCKLISTED;
}
return m_client->get_watch_notify()->watch(m_client, m_pool_id,
int TestIoCtxImpl::execute_operation(const std::string& oid,
const Operation &operation) {
- if (m_client->is_blacklisted()) {
- return -EBLACKLISTED;
+ if (m_client->is_blocklisted()) {
+ return -EBLOCKLISTED;
}
TestRadosClient::Transaction transaction(m_client, get_namespace(), oid);
int TestIoCtxImpl::execute_aio_operations(const std::string& oid,
TestObjectOperationImpl *ops,
- bufferlist *pbl,
- const SnapContext &snapc) {
+ bufferlist *pbl, uint64_t snap_id,
+ const SnapContext &snapc,
+ uint64_t* objver) {
int ret = 0;
- if (m_client->is_blacklisted()) {
- ret = -EBLACKLISTED;
+ if (m_client->is_blocklisted()) {
+ ret = -EBLOCKLISTED;
} else {
TestRadosClient::Transaction transaction(m_client, get_namespace(), oid);
for (ObjectOperations::iterator it = ops->ops.begin();
it != ops->ops.end(); ++it) {
- ret = (*it)(this, oid, pbl, snapc);
+ ret = (*it)(this, oid, pbl, snap_id, snapc, objver);
if (ret < 0) {
break;
}