From: Amnon Hanuhov Date: Thu, 24 Jun 2021 15:59:53 +0000 (+0300) Subject: crimson/osd: Store a reference to PG inside OpsExecuter X-Git-Tag: v17.1.0~52^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=56bf9df993dafea4b6ccd3acb93a35be1657f33e;p=ceph.git crimson/osd: Store a reference to PG inside OpsExecuter This is needed as some ObjClass methods make use of pg information related to the given cls_method_context_t Signed-off-by: Amnon Hanuhov --- diff --git a/src/crimson/osd/ops_executer.h b/src/crimson/osd/ops_executer.h index d411d500ec7e..d84d43ad712b 100644 --- a/src/crimson/osd/ops_executer.h +++ b/src/crimson/osd/ops_executer.h @@ -151,6 +151,7 @@ private: virtual ~effect_t() = default; }; + Ref pg; // for the sake of object class ObjectContextRef obc; const OpInfo& op_info; const pg_pool_t& pool_info; // for the sake of the ObjClass API @@ -236,12 +237,14 @@ private: public: template - OpsExecuter(ObjectContextRef obc, + OpsExecuter(Ref pg, + ObjectContextRef obc, const OpInfo& op_info, const pg_pool_t& pool_info, PGBackend& backend, const MsgT& msg) - : obc(std::move(obc)), + : pg(std::move(pg)), + obc(std::move(obc)), op_info(op_info), pool_info(pool_info), backend(backend), @@ -262,9 +265,7 @@ public: using rep_op_fut_t = interruptible_future; template - rep_op_fut_t flush_changes_n_do_ops_effects( - Ref pg, - MutFunc&& mut_func) &&; + rep_op_fut_t flush_changes_n_do_ops_effects(MutFunc&& mut_func) &&; const hobject_t &get_target() const { return obc->obs.oi.soid; @@ -330,7 +331,7 @@ auto OpsExecuter::with_effect_on_obc( template OpsExecuter::rep_op_fut_t -OpsExecuter::flush_changes_n_do_ops_effects(Ref pg, MutFunc&& mut_func) && +OpsExecuter::flush_changes_n_do_ops_effects(MutFunc&& mut_func) && { const bool want_mutate = !txn.empty(); // osd_op_params are instantiated by every wr-like operation. diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index aee8e8331657..7fd940f1e76a 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -683,7 +683,6 @@ PG::do_osd_ops_execute( ox->get_target()); peering_state.apply_op_stats(ox->get_target(), ox->get_stats()); return std::move(*ox).flush_changes_n_do_ops_effects( - Ref{this}, [this, &op_info, &ops] (auto&& txn, auto&& obc, auto&& osd_op_p, @@ -751,7 +750,7 @@ PG::do_osd_ops( } return do_osd_ops_execute>( seastar::make_lw_shared( - std::move(obc), op_info, get_pool().info, get_backend(), *m), + Ref{this}, std::move(obc), op_info, *m), m->ops, op_info, [this, m, rvec = op_info.allows_returnvec()] { @@ -795,7 +794,7 @@ PG::do_osd_ops( { return do_osd_ops_execute( seastar::make_lw_shared( - std::move(obc), op_info, get_pool().info, get_backend(), msg_params), + Ref{this}, std::move(obc), op_info, msg_params), ops, std::as_const(op_info), std::move(success_func),