From: Yehuda Sadeh Date: Fri, 9 Jan 2015 22:55:42 +0000 (-0800) Subject: rgw: update calls to handle bucket sharding X-Git-Tag: v0.92~12^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f060dd65614c6e278ea735341568f35f07d34193;p=ceph.git rgw: update calls to handle bucket sharding Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 4b2b09c410a1..dc1113e5e403 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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; }