});
}
+// Defined here because there is a circular dependency between OpsExecuter and PG
+template <class Func>
+auto OpsExecuter::do_const_op(Func&& f) {
+ // TODO: pass backend as read-only
+ return std::forward<Func>(f)(pg->get_backend(), std::as_const(obc->obs));
+}
+
+// Defined here because there is a circular dependency between OpsExecuter and PG
+template <class Func>
+auto OpsExecuter::do_write_op(Func&& f, bool um) {
+ ++num_write;
+ if (!osd_op_params) {
+ osd_op_params.emplace();
+ }
+ user_modify = um;
+ return std::forward<Func>(f)(pg->get_backend(), obc->obs, txn);
+}
+
OpsExecuter::interruptible_errorated_future<OpsExecuter::osd_op_errorator>
OpsExecuter::execute_op(OSDOp& osd_op)
{
Ref<PG> pg; // for the sake of object class
ObjectContextRef obc;
const OpInfo& op_info;
- PGBackend& backend;
ceph::static_ptr<ExecutableMessage,
sizeof(ExecutableMessagePimpl<void>)> msg;
std::optional<osd_op_params_t> osd_op_params;
const ObjectState& os);
template <class Func>
- auto do_const_op(Func&& f) {
- // TODO: pass backend as read-only
- return std::forward<Func>(f)(backend, std::as_const(obc->obs));
- }
+ auto do_const_op(Func&& f);
template <class Func>
auto do_read_op(Func&& f) {
}
template <class Func>
- auto do_write_op(Func&& f, bool um) {
- ++num_write;
- if (!osd_op_params) {
- osd_op_params.emplace();
- }
- user_modify = um;
- return std::forward<Func>(f)(backend, obc->obs, txn);
- }
+ auto do_write_op(Func&& f, bool um);
decltype(auto) dont_do_legacy_op() {
return crimson::ct_error::operation_not_supported::make();
OpsExecuter(Ref<PG> pg,
ObjectContextRef obc,
const OpInfo& op_info,
- PGBackend& backend,
const MsgT& msg)
: pg(std::move(pg)),
obc(std::move(obc)),
op_info(op_info),
- backend(backend),
msg(std::in_place_type_t<ExecutableMessagePimpl<MsgT>>{}, &msg) {
}
}
return do_osd_ops_execute<MURef<MOSDOpReply>>(
seastar::make_lw_shared<OpsExecuter>(
- Ref<PG>{this}, std::move(obc), op_info, get_backend(), *m),
+ Ref<PG>{this}, std::move(obc), op_info, *m),
m->ops,
op_info,
[this, m, rvec = op_info.allows_returnvec()] {
{
return do_osd_ops_execute<void>(
seastar::make_lw_shared<OpsExecuter>(
- Ref<PG>{this}, std::move(obc), op_info, get_backend(), msg_params),
+ Ref<PG>{this}, std::move(obc), op_info, msg_params),
ops,
std::as_const(op_info),
std::move(success_func),