]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: update calls to handle bucket sharding
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 9 Jan 2015 22:55:42 +0000 (14:55 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 14 Jan 2015 03:21:32 +0000 (19:21 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc

index 4b2b09c410a1c03110c808c33e82bfeafb87fd6a..dc1113e5e403942be87dd19e9f6940db4929caab 100644 (file)
@@ -4434,9 +4434,17 @@ int RGWRados::set_attrs(void *ctx, rgw_obj& obj,
   if (!op.size())
     return 0;
 
+  librados::IoCtx index_ctx;
+  BucketShard bs(this);
+  r = bs.init(bucket, obj);
+  if (r < 0) {
+    ldout(cct, 10) << "bs.init() returned r=" << r << dendl;
+    return r;
+  }
+
   string tag;
   if (state) {
-    r = prepare_update_index(state, bucket, CLS_RGW_OP_ADD, obj, tag);
+    r = prepare_update_index(state, bs, CLS_RGW_OP_ADD, obj, tag);
     if (r < 0)
       return r;
   }
@@ -4452,10 +4460,10 @@ int RGWRados::set_attrs(void *ctx, rgw_obj& obj,
       uint64_t epoch = ref.ioctx.get_last_version();
       int64_t poolid = ref.ioctx.get_id();
       utime_t mtime = ceph_clock_now(cct);
-      r = complete_update_index(bucket, obj.object, tag, poolid, epoch, state->size,
+      r = complete_update_index(bs, obj, tag, poolid, epoch, state->size,
                                 mtime, etag, content_type, &acl_bl, RGW_OBJ_CATEGORY_MAIN, NULL);
     } else {
-      int ret = complete_update_index_cancel(bucket, obj.object, tag);
+      int ret = complete_update_index_cancel(bs, obj, tag);
       if (ret < 0) {
         ldout(cct, 0) << "ERROR: comlete_update_index_cancel() returned r=" << r << dendl;
       }