From f218b60da2705f4ea6764fb83444900206cbfc1c Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 1 Mar 2023 10:48:30 -0500 Subject: [PATCH] rgw/rados: use rgw::num_shards() helper Signed-off-by: Casey Bodley (cherry picked from commit c8908fdd4cf4bb6dd14787dd7a49f75b32cc53ce) --- src/rgw/driver/rados/rgw_data_sync.cc | 4 ++-- src/rgw/driver/rados/rgw_rest_log.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rgw/driver/rados/rgw_data_sync.cc b/src/rgw/driver/rados/rgw_data_sync.cc index df952ef08e6..0e9d511342b 100644 --- a/src/rgw/driver/rados/rgw_data_sync.cc +++ b/src/rgw/driver/rados/rgw_data_sync.cc @@ -3621,8 +3621,8 @@ public: } if (!no_zero) { yield { - const int num_shards0 = - source_info.layout.logs.front().layout.in_index.layout.num_shards; + const int num_shards0 = rgw::num_shards( + source_info.layout.logs.front().layout.in_index.layout); call(new CheckAllBucketShardStatusIsIncremental(sc, sync_pair, num_shards0, &all_incremental)); diff --git a/src/rgw/driver/rados/rgw_rest_log.cc b/src/rgw/driver/rados/rgw_rest_log.cc index e0afce0b2ff..f4099807dad 100644 --- a/src/rgw/driver/rados/rgw_rest_log.cc +++ b/src/rgw/driver/rados/rgw_rest_log.cc @@ -507,7 +507,7 @@ void RGWOp_BILog_List::send_response_end() { if (next_log_layout) { s->formatter->open_object_section("next_log"); encode_json("generation", next_log_layout->gen, s->formatter); - encode_json("num_shards", next_log_layout->layout.in_index.layout.num_shards, s->formatter); + encode_json("num_shards", rgw::num_shards(next_log_layout->layout.in_index.layout), s->formatter); s->formatter->close_section(); // next_log } @@ -567,7 +567,7 @@ void RGWOp_BILog_Info::execute(optional_yield y) { latest_gen = logs.back().gen; for (auto& log : logs) { - uint32_t num_shards = log.layout.in_index.layout.num_shards; + uint32_t num_shards = rgw::num_shards(log.layout.in_index.layout); generations.push_back({log.gen, num_shards}); } } -- 2.39.5