* Get all the buckets owned by a user and fill up an RGWUserBuckets with them.
* Returns: 0 on success, -ERR# on failure.
*/
-int rgw_read_user_buckets(RGWRados *store, string user_id, RGWUserBuckets& buckets,
- const string& marker, uint64_t max, bool need_stats)
+int rgw_read_user_buckets(RGWRados * store,
+ string user_id,
+ RGWUserBuckets& buckets,
+ const string& marker,
+ uint64_t max,
+ bool need_stats,
+ uint64_t default_amount)
{
int ret;
buckets.clear();
uint64_t total = 0;
+ if (!max) {
+ max = default_amount;
+ }
+
do {
ret = store->cls_user_list_buckets(obj, m, max - total, entries, &m, &truncated);
if (ret == -ENOENT)
* Get all the buckets owned by a user and fill up an RGWUserBuckets with them.
* Returns: 0 on success, -ERR# on failure.
*/
-extern int rgw_read_user_buckets(RGWRados *store, string user_id, RGWUserBuckets& buckets,
- const string& marker, uint64_t max, bool need_stats);
+extern int rgw_read_user_buckets(RGWRados *store,
+ string user_id,
+ RGWUserBuckets& buckets,
+ const string& marker,
+ uint64_t max,
+ bool need_stats,
+ uint64_t default_amount = 1000);
extern int rgw_link_bucket(RGWRados *store, string user_id, rgw_bucket& bucket, time_t creation_time, bool update_entrypoint = true);
extern int rgw_unlink_bucket(RGWRados *store, string user_id, const string& bucket_name, bool update_entrypoint = true);
read_count = min(limit - total_count, (uint64_t)max_buckets);
ret = rgw_read_user_buckets(store, s->user.user_id, buckets,
- marker, read_count, should_get_stats());
+ marker, read_count, should_get_stats(), 0);
if (!started) {
send_response_begin(buckets.count() > 0);