]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: refactor arrangement of parameters for rgw_read_user_buckets(). 4216/head
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 19 Nov 2015 16:45:12 +0000 (17:45 +0100)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Tue, 8 Dec 2015 16:19:59 +0000 (17:19 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_bucket.cc
src/rgw/rgw_bucket.h
src/rgw/rgw_op.cc
src/rgw/rgw_user.cc

index 3224f9acd3cb6529f68112e04942c250cfd440ef..7a175ec79b518cf71434b853fc538bc94d60de58 100644 (file)
@@ -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;
 
index 1a3b2454d7165f5ac3586efb8ba352dfdb812958..16602e8808a8286791815c3c55daf3a89eb1094b 100644 (file)
@@ -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,
index bdda5efbc6105f598edd6b9b29746b94429a30ba..2a578fc184ca64d3be4320bedc7d7d76a5fe23b5 100644 (file)
@@ -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;
 
index 5063cd0ccfc517cf80ecd5f37494fcb410f5d82c..95c4fc66663d75b530c82cc3fd40268d4ddd5c4c 100644 (file)
@@ -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;