]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW/multisite: bucket_list_result object provides a method to reset its entries
authorOguzhan Ozmen <oozmen@bloomberg.net>
Tue, 11 Nov 2025 16:14:41 +0000 (16:14 +0000)
committerOguzhan Ozmen <oozmen@bloomberg.net>
Thu, 19 Mar 2026 19:57:12 +0000 (19:57 +0000)
Add a new method `reset_entries()` to the `bucket_list_result` struct
that clears the list of entries and resets the truncated flag.

This would be used to enhance the re-use cases to avoid accessing stale
entries or truncated flag.

Signed-off-by: Oguzhan Ozmen <oozmen@bloomberg.net>
(cherry picked from commit ae59eac57f2cdc7784f413c86dff99f27382bacb)

src/rgw/driver/rados/rgw_data_sync.cc

index 80b4401d9375bf9f6d16e87eaa4acd67b9cedb8a..d4e8c7f3f02b55f117f44f8a58e56fa783139c01 100644 (file)
@@ -4033,6 +4033,11 @@ struct bucket_list_result {
 
   bucket_list_result() : max_keys(0), is_truncated(false) {}
 
+  void reset_entries() {
+    entries.clear();
+    is_truncated = false;
+  }
+
   void decode_json(JSONObj *obj) {
     JSONDecoder::decode_json("Name", name, obj);
     JSONDecoder::decode_json("Prefix", prefix, obj);