]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fixing rebase casualties
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 28 Jan 2015 23:54:23 +0000 (15:54 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 28 Jan 2015 23:56:10 +0000 (15:56 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rest_replica_log.cc

index ddcf635814de9031999ba75fa8c80522aaf801c8..543974a455c492749ef33a70cc590176490fdd26 100644 (file)
@@ -146,7 +146,7 @@ void RGWOp_OBJLog_DeleteBounds::execute() {
   http_ret = rl.delete_bound(shard, daemon_id, purge_all);
 }
 
-static int bucket_instance_to_bucket(RGWRados *store, string& bucket_instance, rgw_bucket& bucket) {
+static int bucket_instance_to_bucket(RGWRados *store, const string& bucket_instance, rgw_bucket& bucket) {
   RGWBucketInfo bucket_info;
   time_t mtime;
   
@@ -162,10 +162,8 @@ static int bucket_instance_to_bucket(RGWRados *store, string& bucket_instance, r
   return 0;
 }
 
-static int get_bucket_for_bounds(RGWRados *store, XMLArgs& args, rgw_bucket& bucket, bool *index_by_instance)
+static int get_bucket_for_bounds(RGWRados *store, XMLArgs& args, const string& bucket_instance, rgw_bucket& bucket, bool *index_by_instance)
 {
-  string bucket_instance = args.get("bucket-instance");
-
   args.get_bool("index-by-instance", index_by_instance, true);
 
   if (*index_by_instance) {
@@ -235,7 +233,7 @@ void RGWOp_BILog_SetBounds::execute() {
   rgw_bucket bucket;
   bool index_by_instance;
 
-  if ((http_ret = get_bucket_for_bounds(store, s->info.args, bucket, &index_by_instance)) < 0) {
+  if ((http_ret = get_bucket_for_bounds(store, s->info.args, bucket_instance, bucket, &index_by_instance)) < 0) {
     return;
   }
   
@@ -256,17 +254,18 @@ void RGWOp_BILog_GetBounds::execute() {
   rgw_bucket bucket;
   bool index_by_instance;
 
-  if ((http_ret = get_bucket_for_bounds(store, s->info.args, bucket, &index_by_instance)) < 0) {
-    return;
-  }
-
   int shard_id;
+
   http_ret = rgw_bucket_parse_bucket_instance(bucket_instance, &bucket_instance, &shard_id);
   if (http_ret < 0) {
     dout(5) << "failed to parse bucket instance" << dendl;
     return;
   }
 
+  if ((http_ret = get_bucket_for_bounds(store, s->info.args, bucket_instance, bucket, &index_by_instance)) < 0) {
+    return;
+  }
+
   if ((http_ret = bucket_instance_to_bucket(store, bucket_instance, bucket)) < 0) 
     return;
 
@@ -309,11 +308,10 @@ void RGWOp_BILog_DeleteBounds::execute() {
   rgw_bucket bucket;
   bool index_by_instance;
 
-  if ((http_ret = get_bucket_for_bounds(store, s->info.args, bucket, &index_by_instance)) < 0) {
+  if ((http_ret = get_bucket_for_bounds(store, s->info.args, bucket_instance, bucket, &index_by_instance)) < 0) {
     return;
   }
 
-
   RGWReplicaBucketLogger rl(store);
   http_ret = rl.delete_bound(bucket, shard_id, daemon_id, index_by_instance, purge_all);
 }