using Op = detail::AsyncOp<bufferlist>;
using Signature = typename Op::Signature;
return boost::asio::async_initiate<CompletionToken, Signature>(
- [] (auto handler, IoExecutor ex, IoCtx& io, const std::string& oid,
- size_t len, uint64_t off) {
+ [] (auto handler, IoExecutor ex, const IoCtx& i,
+ const std::string& oid, size_t len, uint64_t off) {
constexpr bool is_read = true;
auto p = Op::create(ex, is_read, std::move(handler));
auto& op = p->user_data;
+ IoCtx& io = const_cast<IoCtx&>(i);
int ret = io.aio_read(oid, op.aio_completion.get(), &op.result, len, off);
if (ret < 0) {
auto ec = boost::system::error_code{-ret, librados::detail::err_category()};
using Op = detail::AsyncOp<void>;
using Signature = typename Op::Signature;
return boost::asio::async_initiate<CompletionToken, Signature>(
- [] (auto handler, IoExecutor ex, IoCtx& io, const std::string& oid,
+ [] (auto handler, IoExecutor ex, const IoCtx& i, const std::string& oid,
const bufferlist &bl, size_t len, uint64_t off) {
constexpr bool is_read = false;
auto p = Op::create(ex, is_read, std::move(handler));
auto& op = p->user_data;
+ IoCtx& io = const_cast<IoCtx&>(i);
int ret = io.aio_write(oid, op.aio_completion.get(), bl, len, off);
if (ret < 0) {
auto ec = boost::system::error_code{-ret, librados::detail::err_category()};
using Op = detail::AsyncOp<bufferlist>;
using Signature = typename Op::Signature;
return boost::asio::async_initiate<CompletionToken, Signature>(
- [] (auto handler, IoExecutor ex, IoCtx& io, const std::string& oid,
+ [] (auto handler, IoExecutor ex, const IoCtx& i, const std::string& oid,
ObjectReadOperation *read_op, int flags) {
constexpr bool is_read = true;
auto p = Op::create(ex, is_read, std::move(handler));
auto& op = p->user_data;
+ IoCtx& io = const_cast<IoCtx&>(i);
int ret = io.aio_operate(oid, op.aio_completion.get(), read_op,
flags, &op.result);
if (ret < 0) {
using Op = detail::AsyncOp<void>;
using Signature = typename Op::Signature;
return boost::asio::async_initiate<CompletionToken, Signature>(
- [] (auto handler, IoExecutor ex, IoCtx& io, const std::string& oid,
+ [] (auto handler, IoExecutor ex, const IoCtx& i, const std::string& oid,
ObjectWriteOperation *write_op, int flags,
const jspan_context* trace_ctx) {
constexpr bool is_read = false;
auto p = Op::create(ex, is_read, std::move(handler));
auto& op = p->user_data;
+ IoCtx& io = const_cast<IoCtx&>(i);
int ret = io.aio_operate(oid, op.aio_completion.get(), write_op, flags, trace_ctx);
if (ret < 0) {
auto ec = boost::system::error_code{-ret, librados::detail::err_category()};
using Op = detail::AsyncOp<bufferlist>;
using Signature = typename Op::Signature;
return boost::asio::async_initiate<CompletionToken, Signature>(
- [] (auto handler, IoExecutor ex, IoCtx& io, const std::string& oid,
- bufferlist& bl, uint64_t timeout_ms) {
+ [] (auto handler, IoExecutor ex, const IoCtx& i, const std::string& oid,
+ const bufferlist& b, uint64_t timeout_ms) {
constexpr bool is_read = false;
auto p = Op::create(ex, is_read, std::move(handler));
auto& op = p->user_data;
+ IoCtx& io = const_cast<IoCtx&>(i);
+ bufferlist& bl = const_cast<bufferlist&>(b);
int ret = io.aio_notify(oid, op.aio_completion.get(),
bl, timeout_ms, &op.result);
if (ret < 0) {