From 0f9548613323120dace95e53f67f58c6e54acd9f Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 11 Jan 2024 21:55:18 +0000 Subject: [PATCH] osd: introduce aliases around EC reads Signed-off-by: Radoslaw Zarzynski --- src/osd/ECBackend.cc | 4 ++-- src/osd/ECBackend.h | 9 ++++----- src/osd/ECCommon.cc | 11 ++++------- src/osd/ECCommon.h | 19 ++++++++++--------- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 74f58520d46f3..e2de6dfee9860 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -1539,8 +1539,8 @@ int ECBackend::objects_read_sync( void ECBackend::objects_read_async( const hobject_t &hoid, - const list, - pair > > &to_read, + const list>> &to_read, Context *on_complete, bool fast_read) { diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index e61ec6a0cc5c8..910cdc064e4ff 100644 --- a/src/osd/ECBackend.h +++ b/src/osd/ECBackend.h @@ -141,15 +141,14 @@ public: * check_recovery_sources. */ void objects_read_and_reconstruct( - const std::map > - > &reads, + const std::map> &reads, bool fast_read, - GenContextURef > &&> &&func) override; + GenContextURef &&func) override; void objects_read_async( const hobject_t &hoid, - const std::list, - std::pair > > &to_read, + const std::list>> &to_read, Context *on_complete, bool fast_read = false) override; diff --git a/src/osd/ECCommon.cc b/src/osd/ECCommon.cc index 8752b54b46290..6b16431e01fc0 100644 --- a/src/osd/ECCommon.cc +++ b/src/osd/ECCommon.cc @@ -525,11 +525,9 @@ out: }; void ECCommon::ReadPipeline::objects_read_and_reconstruct( - const map > - > &reads, + const map> &reads, bool fast_read, - GenContextURef > &&> &&func) + GenContextURef &&func) { in_progress_client_reads.emplace_back( reads.size(), std::move(func)); @@ -589,8 +587,7 @@ int ECCommon::ReadPipeline::send_all_remaining_reads( if (r) return r; - list > offsets = - rop.to_read.find(hoid)->second.to_read; + list to_read = rop.to_read.find(hoid)->second.to_read; // (Note cuixf) If we need to read attrs and we read failed, try to read again. bool want_attrs = @@ -604,7 +601,7 @@ int ECCommon::ReadPipeline::send_all_remaining_reads( rop.to_read.insert(make_pair( hoid, read_request_t( - offsets, + to_read, shards, want_attrs))); return 0; diff --git a/src/osd/ECCommon.h b/src/osd/ECCommon.h index 3ceb3d295b2a9..7112080cb2a82 100644 --- a/src/osd/ECCommon.h +++ b/src/osd/ECCommon.h @@ -209,6 +209,9 @@ struct ECListener { }; struct ECCommon { + using ec_align_t = boost::tuple; + using ec_extents_t = std::map>; + virtual ~ECCommon() = default; virtual void handle_sub_write( @@ -220,10 +223,9 @@ struct ECCommon { ) = 0; virtual void objects_read_and_reconstruct( - const std::map > - > &reads, + const std::map> &reads, bool fast_read, - GenContextURef > &&> &&func) = 0; + GenContextURef &&func) = 0; struct read_request_t { const std::list > to_read; @@ -282,8 +284,8 @@ struct ECCommon { friend struct CallClientContexts; struct ClientAsyncReadStatus { unsigned objects_to_read; - GenContextURef > &&> func; - std::map > results; + GenContextURef func; + ec_extents_t results; explicit ClientAsyncReadStatus( unsigned objects_to_read, GenContextURef > &&> &&func) @@ -365,10 +367,9 @@ struct ECCommon { }; struct ReadPipeline { void objects_read_and_reconstruct( - const std::map > - > &reads, + const std::map> &reads, bool fast_read, - GenContextURef > &&> &&func); + GenContextURef &&func); template void filter_read_op( @@ -618,7 +619,7 @@ struct ECCommon { const std::map &to_read, Func &&on_complete ) { - std::map > > _to_read; + std::map> _to_read; for (auto &&hpair: to_read) { auto &l = _to_read[hpair.first]; for (auto extent: hpair.second) { -- 2.39.5