From: Oguzhan Ozmen Date: Tue, 11 Nov 2025 16:14:41 +0000 (+0000) Subject: RGW/multisite: bucket_list_result object provides a method to reset its entries X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae59eac57f2cdc7784f413c86dff99f27382bacb;p=ceph-ci.git RGW/multisite: bucket_list_result object provides a method to reset its entries 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 --- diff --git a/src/rgw/driver/rados/rgw_data_sync.cc b/src/rgw/driver/rados/rgw_data_sync.cc index 9e4b678bd93..83c1757439a 100644 --- a/src/rgw/driver/rados/rgw_data_sync.cc +++ b/src/rgw/driver/rados/rgw_data_sync.cc @@ -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);