]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: send correct object id to class op
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 23 Sep 2011 05:33:28 +0000 (22:33 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 23 Sep 2011 05:33:28 +0000 (22:33 -0700)
src/cls_rgw.cc
src/rgw/rgw_rados.cc

index d543d0e35c9b3d6cb2fd30a558328f073a32a012..3f9fb1c9d1a752dc3b10d16a67b903c6ddef22a9 100644 (file)
@@ -146,6 +146,7 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist
   } else {
     entry = &dir.m[op.name];
     entry->name = op.name;
+    entry->epoch = 0;
     entry->exists = false;
   }
 
@@ -188,6 +189,8 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
   std::map<string, struct rgw_bucket_dir_entry>::iterator miter = dir.m.find(op.name);
   struct rgw_bucket_dir_entry *entry = NULL;
 
+  CLS_LOG("rgw_bucket_modify(): dir.m.size()=%lld", dir.m.size());
+
   if (miter != dir.m.end()) {
     entry = &miter->second;
     CLS_LOG("rgw_bucket_modify(): existing entry: epoch=%lld\n", entry->epoch);
index c1c9d0a605db451be06650d048b8faa30156ab6f..fadd028d28fbe01689069829713608e52c989abc 100644 (file)
@@ -765,7 +765,7 @@ int RGWRados::delete_obj_impl(void *ctx, std::string& id, rgw_obj& obj, bool syn
     } else {
       append_rand_alpha(tag, tag, 32);
     }
-    int ret = cls_obj_prepare_op(bucket, CLS_RGW_OP_ADD, tag, oid);
+    int ret = cls_obj_prepare_op(bucket, CLS_RGW_OP_ADD, tag, obj.object);
     if (ret < 0)
       return ret;
     r = io_ctx.operate(oid, &op);
@@ -1327,7 +1327,7 @@ int RGWRados::clone_objs_impl(void *ctx, rgw_obj& dst_obj,
   } else {
     append_rand_alpha(tag, tag, 32);
   }
-  int ret = cls_obj_prepare_op(bucket, CLS_RGW_OP_ADD, tag, dst_oid);
+  int ret = cls_obj_prepare_op(bucket, CLS_RGW_OP_ADD, tag, dst_obj.object);
   if (ret < 0)
     goto done;
 
@@ -1908,7 +1908,6 @@ int RGWRados::cls_bucket_list(rgw_bucket& bucket, string start, uint32_t num, ma
   for (miter = dir.m.begin(); miter != dir.m.end(); ++miter) {
     RGWObjEnt e;
     rgw_bucket_dir_entry& dirent = miter->second;
-
     if (!dirent.exists)
       continue;