From: Radoslaw Zarzynski Date: Tue, 30 Mar 2021 18:38:47 +0000 (+0000) Subject: crimson/osd: expose the non-MOSDOp-taking variant of do_osd_ops() externally. X-Git-Tag: v17.1.0~1984^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4823d04200b999aba43d24bc3de597be51b05f3;p=ceph.git crimson/osd: expose the non-MOSDOp-taking variant of do_osd_ops() externally. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index feb477439056..be22c72c398d 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -803,6 +803,26 @@ PG::do_osd_ops( ).finally([ox_deleter=std::move(ox)] {}); } +PG::do_osd_ops_iertr::future<> +PG::do_osd_ops( + ObjectContextRef obc, + std::vector ops, + const OpInfo &op_info, + const do_osd_ops_params_t& msg_params, + do_osd_ops_success_func_t success_func, + do_osd_ops_failure_func_t failure_func) +{ + auto ox = std::make_unique( + std::move(obc), op_info, get_pool().info, get_backend(), msg_params); + return do_osd_ops_execute( + std::move(*ox), + std::move(ops), + std::as_const(op_info), + std::move(success_func), + std::move(failure_func) + ).finally([ox_deleter=std::move(ox)] {}); +} + PG::interruptible_future> PG::do_pg_ops(Ref m) { if (__builtin_expect(stopping, false)) { diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index 2d109e77fa4b..d7f9b2a88e52 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -577,6 +577,18 @@ private: Ref m, ObjectContextRef obc, const OpInfo &op_info); + using do_osd_ops_success_func_t = + std::function()>; + using do_osd_ops_failure_func_t = + std::function(const std::error_code&)>; + struct do_osd_ops_params_t; + do_osd_ops_iertr::future<> do_osd_ops( + ObjectContextRef obc, + std::vector ops, + const OpInfo &op_info, + const do_osd_ops_params_t& params, + do_osd_ops_success_func_t success_func, + do_osd_ops_failure_func_t failure_func); template do_osd_ops_iertr::future do_osd_ops_execute( OpsExecuter&& ox, @@ -750,6 +762,29 @@ private: friend class IOInterruptCondition; }; +struct PG::do_osd_ops_params_t { + crimson::net::ConnectionRef get_connection() const { + return nullptr; + } + osd_reqid_t get_reqid() const { + return reqid; + } + epoch_t get_map_epoch() const { + return map_epoch; + } + entity_inst_t get_orig_source_inst() const { + return orig_source_inst; + } + uint64_t get_features() const { + return features; + } + crimson::net::ConnectionRef conn; + osd_reqid_t reqid; + epoch_t map_epoch; + entity_inst_t orig_source_inst; + uint64_t features; +}; + std::ostream& operator<<(std::ostream&, const PG& pg); }