diff options
author | Yehuda Sadeh <yehuda@redhat.com> | 2014-10-21 00:11:12 +0200 |
---|---|---|
committer | Yehuda Sadeh <yehuda@redhat.com> | 2015-01-20 00:57:46 +0100 |
commit | 9c347b920346f0799c0ea71f46515ce9b6b75247 (patch) | |
tree | 8c981515bf92c9031f7045d9f9054502351684f5 /src/cls/rgw/cls_rgw_client.cc | |
parent | cls_rgw: keep null-versioned object as versioned object (diff) | |
download | ceph-9c347b920346f0799c0ea71f46515ce9b6b75247.tar.xz ceph-9c347b920346f0799c0ea71f46515ce9b6b75247.zip |
rgw-admin, cls_rgw: add bi_get objclass operation
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src/cls/rgw/cls_rgw_client.cc')
-rw-r--r-- | src/cls/rgw/cls_rgw_client.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cls/rgw/cls_rgw_client.cc b/src/cls/rgw/cls_rgw_client.cc index 9d337d1bbb1..d9eed8c19b6 100644 --- a/src/cls/rgw/cls_rgw_client.cc +++ b/src/cls/rgw/cls_rgw_client.cc @@ -103,6 +103,34 @@ void cls_rgw_remove_obj(librados::ObjectWriteOperation& o, list<string>& keep_at o.exec("rgw", "obj_remove", in); } +int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid, + BIIndexType index_type, cls_rgw_obj_key& key, + string *idx, + bufferlist *data) +{ + bufferlist in, out; + struct rgw_cls_bi_get_op call; + call.key = key; + call.type = index_type; + ::encode(call, in); + int r = io_ctx.exec(oid, "rgw", "bi_get", in, out); + if (r < 0) + return r; + + struct rgw_cls_bi_get_ret op_ret; + bufferlist::iterator iter = out.begin(); + try { + ::decode(op_ret, iter); + } catch (buffer::error& err) { + return -EIO; + } + + *idx = op_ret.idx; + data->swap(op_ret.data); + + return 0; +} + int cls_rgw_bucket_link_olh(librados::IoCtx& io_ctx, const string& oid, const cls_rgw_obj_key& key, bool delete_marker, const string& op_tag) { |