]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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>
Fri, 13 Feb 2026 03:47:49 +0000 (03:47 +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>
src/rgw/driver/rados/rgw_data_sync.cc

index 9e4b678bd931ff54b4a42958841cca52866cea8a..83c1757439afb4e9f4d17e0d205ebf80f66005b7 100644 (file)
@@ -4034,6 +4034,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);