]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_cr_rados.cc
update sources to v12.1.2
[ceph.git] / ceph / src / rgw / rgw_cr_rados.cc
index 353deaa67ecfbf2a2aca15b1a2b5f45539476344..fabf387e70f3b7a6077b27aea40299e58db87fd7 100644 (file)
@@ -1,10 +1,11 @@
 #include "rgw_rados.h"
 #include "rgw_coroutine.h"
-#include "rgw_boost_asio_yield.h"
 #include "rgw_cr_rados.h"
 
 #include "cls/lock/cls_lock_client.h"
 
+#include <boost/asio/yield.hpp>
+
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rgw
 
@@ -200,7 +201,6 @@ RGWAsyncUnlockSystemObj::RGWAsyncUnlockSystemObj(RGWCoroutine *caller, RGWAioCom
 {
 }
 
-
 RGWRadosSetOmapKeysCR::RGWRadosSetOmapKeysCR(RGWRados *_store,
                       const rgw_raw_obj& _obj,
                       map<string, bufferlist>& _entries) : RGWSimpleCoroutine(_store->ctx()),
@@ -219,13 +219,6 @@ RGWRadosSetOmapKeysCR::RGWRadosSetOmapKeysCR(RGWRados *_store,
   s << "]";
 }
 
-RGWRadosSetOmapKeysCR::~RGWRadosSetOmapKeysCR()
-{
-  if (cn) {
-    cn->put();
-  }
-}
-
 int RGWRadosSetOmapKeysCR::send_request()
 {
   int r = store->get_raw_obj_ref(obj, &ref);
@@ -240,7 +233,6 @@ int RGWRadosSetOmapKeysCR::send_request()
   op.omap_set(entries);
 
   cn = stack->create_completion_notifier();
-  cn->get();
   return ref.ioctx.aio_operate(ref.oid, cn->completion(), &op);
 }
 
@@ -265,10 +257,6 @@ RGWRadosGetOmapKeysCR::RGWRadosGetOmapKeysCR(RGWRados *_store,
   set_description() << "set omap keys dest=" << obj << " marker=" << marker;
 }
 
-RGWRadosGetOmapKeysCR::~RGWRadosGetOmapKeysCR()
-{
-}
-
 int RGWRadosGetOmapKeysCR::send_request() {
   int r = store->get_raw_obj_ref(obj, &ref);
   if (r < 0) {
@@ -295,10 +283,6 @@ RGWRadosRemoveOmapKeysCR::RGWRadosRemoveOmapKeysCR(RGWRados *_store,
   set_description() << "remove omap keys dest=" << obj << " keys=" << keys;
 }
 
-RGWRadosRemoveOmapKeysCR::~RGWRadosRemoveOmapKeysCR()
-{
-}
-
 int RGWRadosRemoveOmapKeysCR::send_request() {
   int r = store->get_raw_obj_ref(obj, &ref);
   if (r < 0) {
@@ -315,6 +299,15 @@ int RGWRadosRemoveOmapKeysCR::send_request() {
   return ref.ioctx.aio_operate(ref.oid, cn->completion(), &op);
 }
 
+int RGWRadosRemoveOmapKeysCR::request_complete()
+{
+  int r = cn->completion()->get_return_value();
+
+  set_status() << "request complete; ret=" << r;
+
+  return r;
+}
+
 RGWRadosRemoveCR::RGWRadosRemoveCR(RGWRados *store, const rgw_raw_obj& obj)
   : RGWSimpleCoroutine(store->ctx()), store(store), obj(obj)
 {
@@ -426,7 +419,6 @@ int RGWSimpleRadosUnlockCR::request_complete()
   return req->get_ret_status();
 }
 
-
 int RGWOmapAppend::operate() {
   reenter(this) {
     for (;;) {
@@ -541,9 +533,9 @@ int RGWAsyncFetchRemoteObj::_send_request()
                        &key.instance, /* string *version_id, */
                        NULL, /* string *ptag, */
                        NULL, /* string *petag, */
-                       NULL, /* struct rgw_err *err, */
                        NULL, /* void (*progress_cb)(off_t, void *), */
-                       NULL); /* void *progress_data*); */
+                       NULL, /* void *progress_data*); */
+                       zones_trace); 
 
   if (r < 0) {
     ldout(store->ctx(), 0) << "store->fetch_remote_obj() returned r=" << r << dendl;
@@ -646,6 +638,7 @@ int RGWAsyncRemoveObj::_send_request()
   del_op.params.obj_owner.set_name(owner_display_name);
   del_op.params.mtime = timestamp;
   del_op.params.high_precision_time = true;
+  del_op.params.zones_trace = zones_trace;
 
   ret = del_op.delete_obj();
   if (ret < 0) {
@@ -690,19 +683,11 @@ RGWRadosTimelogAddCR::RGWRadosTimelogAddCR(RGWRados *_store, const string& _oid,
   entries.push_back(entry);
 }
 
-RGWRadosTimelogAddCR::~RGWRadosTimelogAddCR()
-{
-  if (cn) {
-    cn->put();
-  }
-}
-
 int RGWRadosTimelogAddCR::send_request()
 {
   set_status() << "sending request";
 
   cn = stack->create_completion_notifier();
-  cn->get();
   return store->time_log_add(oid, entries, cn->completion(), true);
 }
 
@@ -730,19 +715,11 @@ RGWRadosTimelogTrimCR::RGWRadosTimelogTrimCR(RGWRados *store,
       << " from_marker=" << from_marker << " to_marker=" << to_marker;
 }
 
-RGWRadosTimelogTrimCR::~RGWRadosTimelogTrimCR()
-{
-  if (cn) {
-    cn->put();
-  }
-}
-
 int RGWRadosTimelogTrimCR::send_request()
 {
   set_status() << "sending request";
 
   cn = stack->create_completion_notifier();
-  cn->get();
   return store->time_log_trim(oid, start_time, end_time, from_marker,
                               to_marker, cn->completion());
 }