class PG;
// OpsExecuter -- a class for executing ops targeting a certain object.
-class OpsExecuter : public seastar::enable_lw_shared_from_this<OpsExecuter> {
+class OpsExecuter {
friend class SnapTrimObjSubEvent;
using call_errorator = crimson::errorator<
struct OpsExecuter::RollbackHelper {
void rollback_obc_if_modified();
void rollback_obc_if_modified(const std::error_code& e);
- seastar::lw_shared_ptr<OpsExecuter> ox;
+ OpsExecuter *ox;
Func func;
};
template <class Func>
inline OpsExecuter::RollbackHelper<Func>
OpsExecuter::create_rollbacker(Func&& func) {
- return {shared_from_this(), std::forward<Func>(func)};
+ return {this, std::forward<Func>(func)};
}
template <class Func>
co_return;
}
- auto ox = seastar::make_lw_shared<OpsExecuter>(
- pg, obc, op_info, *m, r_conn, snapc);
+ OpsExecuter ox(pg, obc, op_info, *m, r_conn, snapc);
auto ret = co_await pg->run_executer(
ox, obc, op_info, m->ops
).si_then([]() -> std::optional<std::error_code> {
{
LOG_PREFIX(InternalClientRequest::do_process);
auto params = get_do_osd_ops_params();
- auto ox = seastar::make_lw_shared<OpsExecuter>(
+ OpsExecuter ox(
pg, obc, op_info, params, params.get_connection(), SnapContext{});
co_await pg->run_executer(
ox, obc, op_info, osd_ops
}
PG::run_executer_fut PG::run_executer(
- seastar::lw_shared_ptr<OpsExecuter> ox,
+ OpsExecuter &ox,
ObjectContextRef obc,
const OpInfo &op_info,
std::vector<OSDOp>& ops)
{
LOG_PREFIX(PG::run_executer);
- auto rollbacker = ox->create_rollbacker(
+ auto rollbacker = ox.create_rollbacker(
[stored_obc=duplicate_obc(obc)](auto &obc) mutable {
obc->update_from(*stored_obc);
});
});
for (auto &op: ops) {
- DEBUGDPP("object {} handle op {}", *this, ox->get_target(), op);
- co_await ox->execute_op(op);
+ DEBUGDPP("object {} handle op {}", *this, ox.get_target(), op);
+ co_await ox.execute_op(op);
}
- DEBUGDPP("object {} all operations successful", *this, ox->get_target());
+ DEBUGDPP("object {} all operations successful", *this, ox.get_target());
// check for full
- if ((ox->delta_stats.num_bytes > 0 ||
- ox->delta_stats.num_objects > 0) &&
+ if ((ox.delta_stats.num_bytes > 0 ||
+ ox.delta_stats.num_objects > 0) &&
get_pgpool().info.has_flag(pg_pool_t::FLAG_FULL)) {
- const auto& m = ox->get_message();
+ const auto& m = ox.get_message();
if (m.get_reqid().name.is_mds() || // FIXME: ignore MDS for now
m.has_flag(CEPH_OSD_FLAG_FULL_FORCE)) {
INFODPP("full, but proceeding due to FULL_FORCE, or MDS", *this);
}
PG::submit_executer_fut PG::submit_executer(
- seastar::lw_shared_ptr<OpsExecuter> ox,
- const std::vector<OSDOp>& ops)
-{
+ OpsExecuter &&ox,
+ const std::vector<OSDOp>& ops) {
LOG_PREFIX(PG::submit_executer);
// transaction must commit at this point
return std::move(
- *ox
+ ox
).flush_changes_n_do_ops_effects(
ops,
snap_mapper,
run_executer_ertr>;
using run_executer_fut = run_executer_iertr::future<>;
run_executer_fut run_executer(
- seastar::lw_shared_ptr<OpsExecuter> ox,
+ OpsExecuter &ox,
ObjectContextRef obc,
const OpInfo &op_info,
std::vector<OSDOp>& ops);
using submit_executer_fut = interruptible_future<
submit_executer_ret>;
submit_executer_fut submit_executer(
- seastar::lw_shared_ptr<OpsExecuter> ox,
+ OpsExecuter &&ox,
const std::vector<OSDOp>& ops);
struct do_osd_ops_params_t;