From ae59eac57f2cdc7784f413c86dff99f27382bacb Mon Sep 17 00:00:00 2001 From: Oguzhan Ozmen Date: Tue, 11 Nov 2025 16:14:41 +0000 Subject: [PATCH] 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 --- src/rgw/driver/rados/rgw_data_sync.cc | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.47.3