From 8fca471d14096858c8d903a633f7b664dcecee7d Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Tue, 23 Mar 2021 21:21:02 +0000 Subject: [PATCH] crimson/osd: PG::do_osd_ops_execute() doesn't directly takes ObjectContextRef. Signed-off-by: Radoslaw Zarzynski --- src/crimson/osd/ops_executer.h | 3 +++ src/crimson/osd/pg.cc | 13 ++++++------- src/crimson/osd/pg.h | 1 - 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/crimson/osd/ops_executer.h b/src/crimson/osd/ops_executer.h index a2927519ff8..6bac348a057 100644 --- a/src/crimson/osd/ops_executer.h +++ b/src/crimson/osd/ops_executer.h @@ -241,6 +241,9 @@ public: template struct RollbackHelper { interruptible_future<> rollback_obc_if_modified(const std::error_code& e); + ObjectContextRef get_obc() const { + return ox.obc; + } OpsExecuter& ox; Func func; }; diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index d7c4f87a659..fc60f77384e 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -702,7 +702,6 @@ PG::do_osd_ops_iertr::future PG::do_osd_ops_execute( OpsExecuter&& ox, std::vector ops, Ref m, - ObjectContextRef obc, const OpInfo &op_info, SuccessFunc&& success_func, FailureFunc&& failure_func) @@ -743,12 +742,12 @@ PG::do_osd_ops_iertr::future PG::do_osd_ops_execute( }).safe_then_interruptible_tuple([success_func=std::move(success_func)] { return std::move(success_func)(); }, crimson::ct_error::object_corrupted::handle( - [obc, rollbacker, this] (const std::error_code& e) mutable { + [rollbacker, this] (const std::error_code& e) mutable { // this is a path for EIO. it's special because we want to fix the obejct // and try again. that is, the layer above `PG::do_osd_ops` is supposed to // restart the execution. return rollbacker.rollback_obc_if_modified(e).then_interruptible( - [obc, this] { + [obc=rollbacker.get_obc(), this] { return repair_object(obc->obs.oi.soid, obc->obs.oi.version).then_interruptible([] { return do_osd_ops_iertr::future{crimson::ct_error::eagain::make()}; @@ -774,10 +773,10 @@ PG::do_osd_ops( throw crimson::common::system_shutdown_exception(); } auto ox = std::make_unique( - obc, op_info, get_pool().info, get_backend(), *m); + std::move(obc), op_info, get_pool().info, get_backend(), *m); return do_osd_ops_execute>( - std::move(*ox), m->ops, m, obc, op_info, - [this, m, obc, rvec = op_info.allows_returnvec()] { + std::move(*ox), m->ops, m, op_info, + [this, m, rvec = op_info.allows_returnvec()] { // TODO: should stop at the first op which returns a negative retval, // cmpext uses it for returning the index of first unmatched byte int result = m->ops.empty() ? 0 : m->ops.back().rval.code; @@ -793,7 +792,7 @@ PG::do_osd_ops( logger().debug( "do_osd_ops: {} - object {} sending reply", *m, - obc->obs.oi.soid); + m->get_hobj()); return do_osd_ops_iertr::make_ready_future>( std::move(reply)); }, diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index 0e1d7fe1329..ba477ee4404 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -583,7 +583,6 @@ private: OpsExecuter&& ox, std::vector ops, Ref m, - ObjectContextRef obc, const OpInfo &op_info, SuccessFunc&& success_func, FailureFunc&& failure_func); -- 2.39.5