From 42425f8cd3bc6b15f2de692d28893bd401668da3 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Wed, 31 Mar 2021 17:47:00 +0000 Subject: [PATCH] crimson/osd: PG::with_locked_obc() doesn't depend on MOSDOp anymore. Signed-off-by: Radoslaw Zarzynski --- src/crimson/osd/ops_executer.h | 6 +++++- src/crimson/osd/osd_operations/client_request.cc | 3 ++- src/crimson/osd/pg.cc | 7 ++++--- src/crimson/osd/pg.h | 6 +++++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/crimson/osd/ops_executer.h b/src/crimson/osd/ops_executer.h index 498ec07f6ac..3e688d16beb 100644 --- a/src/crimson/osd/ops_executer.h +++ b/src/crimson/osd/ops_executer.h @@ -86,6 +86,7 @@ public: struct ExecutableMessage { virtual crimson::net::ConnectionRef get_connection() const = 0; virtual osd_reqid_t get_reqid() const = 0; + virtual utime_t get_mtime() const = 0; virtual epoch_t get_map_epoch() const = 0; virtual entity_inst_t get_orig_source_inst() const = 0; virtual uint64_t get_features() const = 0; @@ -103,6 +104,9 @@ public: osd_reqid_t get_reqid() const final { return pimpl->get_reqid(); } + utime_t get_mtime() const final { + return pimpl->get_mtime(); + }; epoch_t get_map_epoch() const final { return pimpl->get_map_epoch(); } @@ -330,7 +334,7 @@ OpsExecuter::flush_changes_n_do_ops_effects(Ref pg, MutFunc&& mut_func) && auto maybe_mutated = interruptor::make_interruptible(osd_op_errorator::now()); if (want_mutate) { osd_op_params->req_id = msg->get_reqid(); - //osd_op_params->mtime = msg->get_mtime(); + osd_op_params->mtime = msg->get_mtime(); maybe_mutated = std::forward(mut_func)(std::move(txn), std::move(obc), std::move(*osd_op_params), diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index 2a1e652e137..563ce9af481 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -182,7 +182,8 @@ ClientRequest::process_op(Ref &pg) [this, pg]() mutable -> PG::load_obc_iertr::future<> { logger().debug("{}: got obc lock", *this); op_info.set_from_op(&*m, *pg->get_osdmap()); - return pg->with_locked_obc(m, op_info, [this, pg](auto obc) mutable { + return pg->with_locked_obc(m->get_hobj(), op_info, + [this, pg](auto obc) mutable { return with_blocking_future_interruptible( handle.enter(pp(*pg).process) ).then_interruptible([this, pg, obc]() mutable { diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 69e5e4b838e..35b41fbc294 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -1052,13 +1052,14 @@ PG::reload_obc(crimson::osd::ObjectContext& obc) const } PG::load_obc_iertr::future<> -PG::with_locked_obc(Ref &m, const OpInfo &op_info, - with_obc_func_t &&f) +PG::with_locked_obc(const hobject_t &hobj, + const OpInfo &op_info, + with_obc_func_t &&f) { if (__builtin_expect(stopping, false)) { throw crimson::common::system_shutdown_exception(); } - const hobject_t oid = get_oid(m->get_hobj()); + const hobject_t oid = get_oid(hobj); switch (get_lock_type(op_info)) { case RWState::RWREAD: if (oid.is_head()) { diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index 2af1619690d..281374e8837 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -523,7 +523,7 @@ public: ObjectContextRef obc, with_obc_func_t&& f); load_obc_iertr::future<> with_locked_obc( - Ref &m, + const hobject_t &hobj, const OpInfo &op_info, with_obc_func_t&& f); @@ -769,6 +769,9 @@ struct PG::do_osd_ops_params_t { osd_reqid_t get_reqid() const { return reqid; } + utime_t get_mtime() const { + return mtime; + }; epoch_t get_map_epoch() const { return map_epoch; } @@ -780,6 +783,7 @@ struct PG::do_osd_ops_params_t { } crimson::net::ConnectionRef conn; osd_reqid_t reqid; + utime_t mtime; epoch_t map_epoch; entity_inst_t orig_source_inst; uint64_t features; -- 2.39.5