From: Radoslaw Zarzynski Date: Tue, 23 Mar 2021 21:21:02 +0000 (+0000) Subject: crimson/osd: PG::do_osd_ops_execute() doesn't directly takes ObjectContextRef. X-Git-Tag: v17.1.0~1984^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8fca471d14096858c8d903a633f7b664dcecee7d;p=ceph.git crimson/osd: PG::do_osd_ops_execute() doesn't directly takes ObjectContextRef. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/osd/ops_executer.h b/src/crimson/osd/ops_executer.h index a2927519ff83..6bac348a0578 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 d7c4f87a659f..fc60f77384ed 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 0e1d7fe1329c..ba477ee44040 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);