]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: bucket index link olh interface
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 9 Sep 2014 18:18:43 +0000 (11:18 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 16 Jan 2015 22:33:47 +0000 (14:33 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/cls/rgw/cls_rgw_client.cc
src/cls/rgw/cls_rgw_client.h
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index ccb30ebde747615284fd387cbacc7de292388bee..9c231f21149e662c4a60d7b9c9cfc1b904ecf587 100644 (file)
@@ -93,6 +93,22 @@ int cls_rgw_list_op(IoCtx& io_ctx, const string& oid,
  return r;
 }
 
+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)
+{
+  bufferlist in, out;
+  struct cls_rgw_link_olh_op call;
+  call.key = key;
+  call.op_tag = op_tag;
+  call.delete_marker = delete_marker;
+  ::encode(call, in);
+  int r = io_ctx.exec(oid, "rgw", "bucket_link_olh", in, out);
+  if (r < 0)
+    return r;
+
+  return 0;
+}
+
 int cls_rgw_bucket_check_index_op(IoCtx& io_ctx, string& oid,
                                  rgw_bucket_dir_header *existing_header,
                                  rgw_bucket_dir_header *calculated_header)
index c7f31d8eb411cb99a78be8fdcdfa6ac7ac8a2bf8..3953c26f9c249a2a0019d53c08ba151d2e3bc40d 100644 (file)
@@ -31,6 +31,9 @@ int cls_rgw_list_op(librados::IoCtx& io_ctx, const string& oid,
                     const string& filter_prefix, uint32_t num_entries,
                     rgw_bucket_dir *dir, bool *is_truncated);
 
+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);
+
 int cls_rgw_bucket_check_index_op(librados::IoCtx& io_ctx, string& oid,
                                  rgw_bucket_dir_header *existing_header,
                                  rgw_bucket_dir_header *calculated_header);
index 351bd903a0f6f70dfe05c2e8e843706efd565a4f..802b6b877d7f0d0be072a6d511497744de00a648 100644 (file)
@@ -5259,6 +5259,32 @@ int RGWRados::olh_init_modification(rgw_obj& obj, string *tag)
   return 0;
 }
 
+int RGWRados::bucket_index_link_olh(rgw_obj& obj_instance, bool delete_marker, const string& op_tag)
+{
+  rgw_rados_ref ref;
+  rgw_bucket bucket;
+  int r = get_obj_ref(obj_instance, &ref, &bucket);
+  if (r < 0) {
+    return r;
+  }
+
+  librados::IoCtx index_ctx;
+  string oid;
+
+  int ret = open_bucket_index(bucket, index_ctx, oid);
+  if (ret < 0) {
+    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, delete_marker, op_tag);
+  if (ret < 0) {
+    return ret;
+  }
+
+  return 0;
+}
+
 static void filter_attrset(map<string, bufferlist>& unfiltered_attrset, const string& check_prefix,
                            map<string, bufferlist> *attrset)
 {
index 902a911df3dd8ade31e4069ff49c728ec7a170c3..c60a9bed56727a4fa20768f288066f9859f274a9 100644 (file)
@@ -1750,6 +1750,7 @@ public:
   int obj_operate(rgw_obj& obj, librados::ObjectReadOperation *op);
 
   int olh_init_modification(rgw_obj& obj, string *tag);
+  int bucket_index_link_olh(rgw_obj& obj_instance, bool delete_marker, const string& op_tag);
 
   int follow_olh(map<string, bufferlist>& attrset, rgw_obj& target);
   int get_olh(rgw_obj& obj, RGWOLHInfo *olh);