ut_et;
void *handle;
unsigned shard_id, max_entries = LOG_CLASS_LIST_MAX_ENTRIES;
- unsigned left_cnt;
-
+
shard_id = (unsigned)strict_strtol(shard.c_str(), 10, &err);
if (!err.empty()) {
dout(5) << "Error parsing shard_id " << shard << dendl;
http_ret = -EINVAL;
return;
}
+ if (max_entries > LOG_CLASS_LIST_MAX_ENTRIES) {
+ max_entries = LOG_CLASS_LIST_MAX_ENTRIES;
+ }
}
if (period.empty()) {
RGWMetadataLog meta_log{s->cct, store, period};
meta_log.init_list_entries(shard_id, ut_st, ut_et, marker, &handle);
- left_cnt = max_entries;
-
- do {
- http_ret = meta_log.list_entries(handle, left_cnt, entries,
- &last_marker, &truncated);
- if (http_ret < 0)
- break;
- left_cnt = max_entries - entries.size();
- } while (truncated && (left_cnt > 0));
+ http_ret = meta_log.list_entries(handle, max_entries, entries,
+ &last_marker, &truncated);
meta_log.complete_list_entries(handle);
}
real_time ut_st,
ut_et;
unsigned shard_id, max_entries = LOG_CLASS_LIST_MAX_ENTRIES;
- unsigned left_cnt;
s->info.args.get_bool("extra-info", &extra_info, false);
http_ret = -EINVAL;
return;
}
- }
-
- dout(10) << __func__ << " shard " << shard << " st " << st << " et " << et << " marker "
- << marker << " max_entries "<< max_entries << dendl;
- left_cnt = max_entries;
+ if (max_entries > LOG_CLASS_LIST_MAX_ENTRIES) {
+ max_entries = LOG_CLASS_LIST_MAX_ENTRIES;
+ }
+ }
- 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,
- left_cnt, entries, marker,
- &last_marker, &truncated);
- if (http_ret < 0)
- break;
-
- assert(max_entries >= entries.size());
- left_cnt = max_entries - entries.size();
- marker = last_marker;
- } while (truncated && (left_cnt > 0));
+ // 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() {