]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_rest_log.cc
update sources to v12.1.1
[ceph.git] / ceph / src / rgw / rgw_rest_log.cc
index 5ba563f4c40195d63a3c9814ad684c18ee8a8996..1dd4216bfe1e3065f64e6870f8584b6aab008c0f 100644 (file)
@@ -20,6 +20,7 @@
 #include "rgw_client_io.h"
 #include "rgw_sync.h"
 #include "rgw_data_sync.h"
+#include "rgw_common.h"
 #include "common/errno.h"
 #include "include/assert.h"
 
@@ -78,6 +79,9 @@ void RGWOp_MDLog_List::execute() {
       http_ret = -EINVAL;
       return;
     }
+    if (max_entries > LOG_CLASS_LIST_MAX_ENTRIES) {
+      max_entries = LOG_CLASS_LIST_MAX_ENTRIES;
+    }
   } 
 
   if (period.empty()) {
@@ -94,15 +98,8 @@ void RGWOp_MDLog_List::execute() {
 
   meta_log.init_list_entries(shard_id, ut_st, ut_et, marker, &handle);
 
-  do {
-    http_ret = meta_log.list_entries(handle, max_entries, entries,
-                                    &last_marker, &truncated);
-    if (http_ret < 0) 
-      break;
-
-    if (!max_entries_str.empty()) 
-      max_entries -= entries.size();
-  } while (truncated && (max_entries > 0));
+  http_ret = meta_log.list_entries(handle, max_entries, entries,
+                                   &last_marker, &truncated);
 
   meta_log.complete_list_entries(handle);
 }
@@ -603,20 +600,16 @@ void RGWOp_DATALog_List::execute() {
       http_ret = -EINVAL;
       return;
     }
-  } 
-  
-  do {
-    // Note that last_marker is updated to be the marker of the last
-    // entry listed
-    http_ret = store->data_log->list_entries(shard_id, ut_st, ut_et, 
-                                            max_entries, entries, marker,
-                                            &last_marker, &truncated);
-    if (http_ret < 0) 
-      break;
-
-    if (!max_entries_str.empty()) 
-      max_entries -= entries.size();
-  } while (truncated && (max_entries > 0));
+    if (max_entries > LOG_CLASS_LIST_MAX_ENTRIES) {
+      max_entries = LOG_CLASS_LIST_MAX_ENTRIES;
+    }
+  }
+
+  // Note that last_marker is updated to be the marker of the last
+  // entry listed
+  http_ret = store->data_log->list_entries(shard_id, ut_st, ut_et,
+                                           max_entries, entries, marker,
+                                           &last_marker, &truncated);
 }
 
 void RGWOp_DATALog_List::send_response() {