]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rados: use rgw::num_shards() helper
authorCasey Bodley <cbodley@redhat.com>
Wed, 1 Mar 2023 15:48:30 +0000 (10:48 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 3 Mar 2023 19:44:26 +0000 (14:44 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit c8908fdd4cf4bb6dd14787dd7a49f75b32cc53ce)

src/rgw/driver/rados/rgw_data_sync.cc
src/rgw/driver/rados/rgw_rest_log.cc

index df952ef08e646d57c9c7fb0de7a25e35eab8b5f6..0e9d511342b27d66a84acf76d21789de03d869a5 100644 (file)
@@ -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));
index e0afce0b2ff0e22821d62e34f30b4c209d1563af..f4099807dadc7b1b9970249e3364669ac0a99202 100644 (file)
@@ -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});
   }
 }