From: Radoslaw Zarzynski Date: Thu, 19 Nov 2015 16:45:12 +0000 (+0100) Subject: rgw: refactor arrangement of parameters for rgw_read_user_buckets(). X-Git-Tag: v10.0.3~105^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94be45263ee9cca0d271586b82407f0383b1c8a3;p=ceph.git rgw: refactor arrangement of parameters for rgw_read_user_buckets(). Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 3224f9acd3cb..7a175ec79b51 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -88,10 +88,10 @@ int rgw_read_user_buckets(RGWRados * store, const rgw_user& user_id, RGWUserBuckets& buckets, const string& marker, + const string& end_marker, uint64_t max, bool need_stats, - uint64_t default_amount, - string end_marker) + uint64_t default_amount) { int ret; buckets.clear(); @@ -368,7 +368,8 @@ void check_bad_user_bucket_mapping(RGWRados *store, const rgw_user& user_id, boo size_t max_entries = cct->_conf->rgw_list_buckets_max_chunk; do { - int ret = rgw_read_user_buckets(store, user_id, user_buckets, marker, max_entries, false); + int ret = rgw_read_user_buckets(store, user_id, user_buckets, + marker, string(), max_entries, false); if (ret < 0) { ldout(store->ctx(), 0) << "failed to read user buckets: " << cpp_strerror(-ret) << dendl; return; @@ -1127,7 +1128,8 @@ int RGWBucketAdminOp::info(RGWRados *store, RGWBucketAdminOpState& op_state, bool done; do { - ret = rgw_read_user_buckets(store, user_id, buckets, marker, max_entries, false); + ret = rgw_read_user_buckets(store, user_id, buckets, + marker, string(), max_entries, false); if (ret < 0) return ret; diff --git a/src/rgw/rgw_bucket.h b/src/rgw/rgw_bucket.h index 1a3b2454d716..16602e8808a8 100644 --- a/src/rgw/rgw_bucket.h +++ b/src/rgw/rgw_bucket.h @@ -119,10 +119,10 @@ extern int rgw_read_user_buckets(RGWRados *store, const rgw_user& user_id, RGWUserBuckets& buckets, const string& marker, + const string& end_marker, uint64_t max, bool need_stats, - uint64_t default_amount = 1000, - string end_marker = string()); + uint64_t default_amount = 1000); extern int rgw_link_bucket(RGWRados *store, const rgw_user& user_id, rgw_bucket& bucket, time_t creation_time, bool update_entrypoint = true); extern int rgw_unlink_bucket(RGWRados *store, const rgw_user& user_id, diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index bdda5efbc610..2a578fc184ca 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1087,7 +1087,7 @@ void RGWListBuckets::execute() } ret = rgw_read_user_buckets(store, s->user.user_id, buckets, - marker, read_count, should_get_stats(), 0, end_marker); + marker, end_marker, read_count, should_get_stats(), 0); if (ret < 0) { /* hmm.. something wrong here.. the user was authenticated, so it @@ -1144,7 +1144,8 @@ void RGWStatAccount::execute() do { RGWUserBuckets buckets; - ret = rgw_read_user_buckets(store, s->user.user_id, buckets, marker, max_buckets, false); + ret = rgw_read_user_buckets(store, s->user.user_id, buckets, + marker, string(), max_buckets, false); if (ret < 0) { /* hmm.. something wrong here.. the user was authenticated, so it should exist */ @@ -1346,7 +1347,8 @@ int RGWCreateBucket::verify_permission() if (s->user.max_buckets) { RGWUserBuckets buckets; string marker; - int ret = rgw_read_user_buckets(store, s->user.user_id, buckets, marker, s->user.max_buckets, false); + int ret = rgw_read_user_buckets(store, s->user.user_id, buckets, + marker, string(), s->user.max_buckets, false); if (ret < 0) return ret; diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index 5063cd0ccfc5..95c4fc66663d 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -55,7 +55,8 @@ int rgw_user_sync_all_stats(RGWRados *store, const rgw_user& user_id) do { RGWUserBuckets user_buckets; - ret = rgw_read_user_buckets(store, user_id, user_buckets, marker, max_entries, false); + ret = rgw_read_user_buckets(store, user_id, user_buckets, + marker, string(), max_entries, false); if (ret < 0) { ldout(cct, 0) << "failed to read user buckets: ret=" << ret << dendl; return ret; @@ -413,7 +414,8 @@ int rgw_delete_user(RGWRados *store, RGWUserInfo& info, RGWObjVersionTracker& ob do { RGWUserBuckets user_buckets; - ret = rgw_read_user_buckets(store, info.user_id, user_buckets, marker, max_buckets, false); + ret = rgw_read_user_buckets(store, info.user_id, user_buckets, + marker, string(), max_buckets, false); if (ret < 0) return ret; @@ -1967,7 +1969,8 @@ int RGWUser::execute_remove(RGWUserAdminOpState& op_state, std::string *err_msg) size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk; do { RGWUserBuckets buckets; - ret = rgw_read_user_buckets(store, uid, buckets, marker, max_buckets, false); + ret = rgw_read_user_buckets(store, uid, buckets, + marker, string(), max_buckets, false); if (ret < 0) { set_err_msg(err_msg, "unable to read user bucket info"); return ret; @@ -2116,7 +2119,8 @@ int RGWUser::execute_modify(RGWUserAdminOpState& op_state, std::string *err_msg) CephContext *cct = store->ctx(); size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk; do { - ret = rgw_read_user_buckets(store, user_id, buckets, marker, max_buckets, false); + ret = rgw_read_user_buckets(store, user_id, buckets, + marker, string(), max_buckets, false); if (ret < 0) { set_err_msg(err_msg, "could not get buckets for uid: " + user_id.to_str()); return ret;