diff options
author | Yehuda Sadeh <yehuda@redhat.com> | 2015-01-23 01:06:57 +0100 |
---|---|---|
committer | Yehuda Sadeh <yehuda@redhat.com> | 2015-01-23 01:06:57 +0100 |
commit | 5548bbe15ffb4f5b79484320f37853667855c930 (patch) | |
tree | 2a6db3a3bf2840e716b9cce71eeda55c91375c08 /src | |
parent | rgw: api adjustments following a merge (diff) | |
download | ceph-5548bbe15ffb4f5b79484320f37853667855c930.tar.xz ceph-5548bbe15ffb4f5b79484320f37853667855c930.zip |
rgw: use bucket shard for olh operations
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/cls/rgw/cls_rgw_client.cc | 2 | ||||
-rw-r--r-- | src/cls/rgw/cls_rgw_client.h | 2 | ||||
-rw-r--r-- | src/rgw/rgw_rados.cc | 47 |
3 files changed, 23 insertions, 28 deletions
diff --git a/src/cls/rgw/cls_rgw_client.cc b/src/cls/rgw/cls_rgw_client.cc index 0556006d1c9..e6ac56b822c 100644 --- a/src/cls/rgw/cls_rgw_client.cc +++ b/src/cls/rgw/cls_rgw_client.cc @@ -364,7 +364,7 @@ int cls_rgw_get_olh_log(IoCtx& io_ctx, string& oid, librados::ObjectReadOperatio return r; } -void cls_rgw_trim_olh_log(librados::ObjectWriteOperation& op, string& oid, const cls_rgw_obj_key& olh, uint64_t ver, const string& olh_tag) +void cls_rgw_trim_olh_log(librados::ObjectWriteOperation& op, const cls_rgw_obj_key& olh, uint64_t ver, const string& olh_tag) { bufferlist in; struct rgw_cls_trim_olh_log_op call; diff --git a/src/cls/rgw/cls_rgw_client.h b/src/cls/rgw/cls_rgw_client.h index b8f8d8698bf..ecec679192e 100644 --- a/src/cls/rgw/cls_rgw_client.h +++ b/src/cls/rgw/cls_rgw_client.h @@ -333,7 +333,7 @@ int cls_rgw_bucket_unlink_instance(librados::IoCtx& io_ctx, const string& oid, c int cls_rgw_get_olh_log(librados::IoCtx& io_ctx, string& oid, librados::ObjectReadOperation& op, const cls_rgw_obj_key& olh, uint64_t ver_marker, const string& olh_tag, map<uint64_t, vector<struct rgw_bucket_olh_log_entry> > *log, bool *is_truncated); -void cls_rgw_trim_olh_log(librados::ObjectWriteOperation& op, string& oid, const cls_rgw_obj_key& olh, uint64_t ver, const string& olh_tag); +void cls_rgw_trim_olh_log(librados::ObjectWriteOperation& op, const cls_rgw_obj_key& olh, uint64_t ver, const string& olh_tag); int cls_rgw_clear_olh(librados::IoCtx& io_ctx, string& oid, const cls_rgw_obj_key& olh, const string& olh_tag); /** diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2d80a059610..609bec9f039 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -5821,16 +5821,15 @@ int RGWRados::bucket_index_link_olh(RGWObjState& olh_state, rgw_obj& obj_instanc return r; } - librados::IoCtx index_ctx; - string oid; - - int ret = open_bucket_index(bucket, index_ctx, oid); + BucketShard bs(this); + int ret = bs.init(bucket, obj_instance); if (ret < 0) { + ldout(cct, 5) << "bs.init() returned ret=" << ret << dendl; return ret; } cls_rgw_obj_key key(obj_instance.get_index_key_name(), obj_instance.get_instance()); - ret = cls_rgw_bucket_link_olh(index_ctx, oid, key, olh_state.olh_tag, delete_marker, op_tag, meta, olh_epoch, + ret = cls_rgw_bucket_link_olh(bs.index_ctx, bs.bucket_obj, key, olh_state.olh_tag, delete_marker, op_tag, meta, olh_epoch, zone_public_config.log_data); if (ret < 0) { return ret; @@ -5854,16 +5853,15 @@ int RGWRados::bucket_index_unlink_instance(rgw_obj& obj_instance, const string& return r; } - librados::IoCtx index_ctx; - string oid; - - int ret = open_bucket_index(bucket, index_ctx, oid); + BucketShard bs(this); + int ret = bs.init(bucket, obj_instance); if (ret < 0) { + ldout(cct, 5) << "bs.init() returned ret=" << ret << dendl; return ret; } cls_rgw_obj_key key(obj_instance.get_index_key_name(), obj_instance.get_instance()); - ret = cls_rgw_bucket_unlink_instance(index_ctx, oid, key, op_tag, olh_epoch, zone_public_config.log_data); + ret = cls_rgw_bucket_unlink_instance(bs.index_ctx, bs.bucket_obj, key, op_tag, olh_epoch, zone_public_config.log_data); if (ret < 0) { return ret; } @@ -5882,11 +5880,10 @@ int RGWRados::bucket_index_read_olh_log(RGWObjState& state, rgw_obj& obj_instanc return r; } - librados::IoCtx index_ctx; - string oid; - - int ret = open_bucket_index(bucket, index_ctx, oid); + BucketShard bs(this); + int ret = bs.init(bucket, obj_instance); if (ret < 0) { + ldout(cct, 5) << "bs.init() returned ret=" << ret << dendl; return ret; } @@ -5896,7 +5893,7 @@ int RGWRados::bucket_index_read_olh_log(RGWObjState& state, rgw_obj& obj_instanc ObjectReadOperation op; - ret = cls_rgw_get_olh_log(index_ctx, oid, op, key, ver_marker, olh_tag, log, is_truncated); + ret = cls_rgw_get_olh_log(bs.index_ctx, bs.bucket_obj, op, key, ver_marker, olh_tag, log, is_truncated); if (ret < 0) return ret; @@ -5912,11 +5909,10 @@ int RGWRados::bucket_index_trim_olh_log(RGWObjState& state, rgw_obj& obj_instanc return r; } - librados::IoCtx index_ctx; - string oid; - - int ret = open_bucket_index(bucket, index_ctx, oid); + BucketShard bs(this); + int ret = bs.init(bucket, obj_instance); if (ret < 0) { + ldout(cct, 5) << "bs.init() returned ret=" << ret << dendl; return ret; } @@ -5926,9 +5922,9 @@ int RGWRados::bucket_index_trim_olh_log(RGWObjState& state, rgw_obj& obj_instanc ObjectWriteOperation op; - cls_rgw_trim_olh_log(op, oid, key, ver, olh_tag); + cls_rgw_trim_olh_log(op, key, ver, olh_tag); - ret = index_ctx.operate(oid, &op); + ret = bs.index_ctx.operate(bs.bucket_obj, &op); if (ret < 0) return ret; @@ -5944,11 +5940,10 @@ int RGWRados::bucket_index_clear_olh(RGWObjState& state, rgw_obj& obj_instance) return r; } - librados::IoCtx index_ctx; - string oid; - - int ret = open_bucket_index(bucket, index_ctx, oid); + BucketShard bs(this); + int ret = bs.init(bucket, obj_instance); if (ret < 0) { + ldout(cct, 5) << "bs.init() returned ret=" << ret << dendl; return ret; } @@ -5956,7 +5951,7 @@ int RGWRados::bucket_index_clear_olh(RGWObjState& state, rgw_obj& obj_instance) cls_rgw_obj_key key(obj_instance.get_index_key_name(), string()); - ret = cls_rgw_clear_olh(index_ctx, oid, key, olh_tag); + ret = cls_rgw_clear_olh(bs.index_ctx, bs.bucket_obj, key, olh_tag); if (ret < 0) { ldout(cct, 5) << "cls_rgw_clear_olh() returned ret=" << ret << dendl; return ret; |